cryptpad: pull from upstream at tag 5.0.0

A new major release 5.0.0 at
https://github.com/xwiki-labs/cryptpad/releases/tag/5.0.0
master v5.0.0
alex 2 years ago
commit 31226a03d2

@ -1,3 +1,67 @@
# 5.0.0
## Goals
This release was centered around two main goals:
1. Implement a new, more modern and minimalist design with rounded corners and simpler colors
2. Remove detailed information about the open-source project from the platform itself and instead host it on the recently deployed project site (https://cryptpad.org)
## Update notes
Recent versions of CryptPad have introduced strict configuration requirements. If you are not already running version `4.14.1` then we recommend you read the notes of our past few releases and apply their updates in sequence. Each version introduces new tests on the checkup page which will help to identify configuration errors that may result in a non-functional server unless corrected.
Version 5.0.0 introduces a new server-side API (`/api/instance`) which serves customized information (server name, description, hosting location) from the admin panel so that it can be displayed on the redesigned home page.
We've done some extra work relative to similar APIs we've introduced in the past to ensure that the client-side code will continue to work without it. The upgrade process should go smoothly even if you fail to apply the suggested updates to your reverse proxy configuration (see `cryptpad/docs/example.nginx.conf`). If this data cannot be retrieved by the client it will fall back to some sensible defaults, but we recommend you take the time to fix it now in case this API ceases to be optional in some future release. The checkup page will identify whether the API is accessible and display an error otherwise.
```diff
diff --git a/docs/example.nginx.conf b/docs/example.nginx.conf
index a2d1cb1ce..23139c58c 100644
--- a/docs/example.nginx.conf
+++ b/docs/example.nginx.conf
@@ -183,7 +183,7 @@ server {
# /api/config is loaded once per page load and is used to retrieve
# the caching variable which is applied to every other resource
# which is loaded during that session.
- location ~ ^/api/(config|broadcast).*$ {
+ location ~ ^/api/.*$ {
proxy_pass http://localhost:3000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
```
To update from `4.14.1` to `5.0.0`:
1. Update your reverse proxy configuration to forward all `/api/` requests to the API server, as per the diff shown above, and reload your reverse proxy config
2. Stop your API server
3. Fetch the latest code with git
4. Install the latest dependencies with `bower update` and `npm i`
5. Restart your server
6. Review your instance's checkup page to ensure that you are passing all tests
## Features
* The most notable feature of this release is its new look: with rounded corners, a more subtle use of colors, and some updated icons.
* As noted above, instance information from the admin panel is now displayed on the home page, making it easier to customize a CryptPad instance without having to edit so many files on the server. In particular, the home page will now display:
1. The instance's configured name or its domain (as a default).
2. The instance's description or a default string.
3. The instance's hosting location (if specified).
4. An optional notice to be displayed as a banner.
* Many of the informational pages have been replaced by a link the project site (cryptpad.org). Links to optional, instance-specific pages like its terms of service, privacy policy, legal notice and contact information are displayed inline, allowing for a smaller footer.
* The drive's directory tree (also shown in teams) can now be resized by dragging its border.
* The checkup page features several new tests, including some which only apply to public instances (a description and location are expected if you have opted into the public instance directory (https://cryptpad.org/instances/).
## Bug fixes
* The font selector in our OnlyOffice-based editors (sheets, docs, presentations) now supports several new fonts, and we've fixed a rendering error which caused the wrong font to be selected when clicking on certain options in the dropdown list (https://github.com/xwiki-labs/cryptpad/issues/898).
* Clicking on an option in the user administration menu (in the top-right corner) didn't automatically close the menu in some cases because some browsers emitted an event while others did not. We now explicitly close this menu when any of its options are clicked.
* We now guard against a type error that occurred when trying to generate a list of documents to "pin" while shared folders were still in the process of synchronizing.
* Thanks to a user report we identified that when a premium user uploaded to a non-premium team the error message incorrectly indicated that the uploaded file exceeded the premium size limit (rather than the non-premium size limit). This resulted in confusing behaviour where a 30MB file was described as being over the 150MB file upload limit. We've updated the resulting error message to display the appropriate size limit and indicate that it is relative to the target drive or team, rather than the user's account.
* Another user reported that they had trouble exporting OnlyOffice documents that contained certain unprintable control characters in their file names. We now remove those unprintable characters when exporting.
* We noticed that very long messages in team invitation links could overflow their container, so we fixed its incorrect styles.
* We observed that some third-party instances had been incorrectly configured such that when they entered an editor's URL (such as `/pad`) they only observed a blank page rather than being redirected to the appropriate URL which contained a trailing slash (ie. `/pad/`). We've added a script which detects such cases and redirects to the appropriate URL if it exists.
# 4.14.1
This minor release fixes a number of bugs that we noticed after deploying 4.14.0.

@ -11,7 +11,7 @@
Support requests for such setups should be directed to their authors.
If you're having difficulty difficulty configuring your instance
we suggest that you join the project's IRC/Matrix channel.
we suggest that you join the project's Matrix channel.
If you don't have any difficulty configuring your instance and you'd like to
support us for the work that went into making it pain-free we are quite happy

@ -7,7 +7,7 @@
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe900;" glyph-name="form-conditional" horiz-adv-x="1094" d="M300.535 78.617c0 3.87-1.548 7.739-4.335 10.525l-45.506 45.507 45.507 45.507c2.787 2.786 4.335 6.656 4.335 10.525s-1.548 7.739-4.335 10.525l-21.051 21.051c-2.787 2.786-6.655 4.334-10.525 4.334s-7.739-1.548-10.525-4.334l-45.507-45.507-45.507 45.507c-2.787 2.786-6.655 4.334-10.525 4.334s-7.739-1.548-10.525-4.334l-21.051-21.051c-2.787-2.786-4.335-6.656-4.335-10.525s1.548-7.739 4.335-10.525l45.507-45.507-45.507-45.507c-2.787-2.786-4.335-6.656-4.335-10.525s1.548-7.74 4.335-10.525l21.051-21.051c2.787-2.787 6.655-4.334 10.525-4.334s7.739 1.548 10.525 4.334l45.507 45.507 45.507-45.507c2.787-2.787 6.655-4.334 10.525-4.334s7.739 1.548 10.525 4.334l21.051 21.051c2.787 2.787 4.335 6.656 4.335 10.525zM999.093 190.682c0 3.87-1.548 7.739-4.335 10.525l-21.050 21.051c-2.787 2.786-6.655 4.334-10.525 4.334s-7.739-1.548-10.525-4.334l-101.54-101.694-45.507 45.662c-2.787 2.786-6.655 4.334-10.525 4.334s-7.739-1.548-10.525-4.334l-21.051-21.051c-2.787-2.786-4.335-6.656-4.335-10.525s1.548-7.739 4.335-10.525l77.083-77.083c2.787-2.787 6.655-4.334 10.525-4.334s7.739 1.548 10.525 4.334l133.116 133.116c2.787 2.786 4.335 6.656 4.335 10.525zM514.273 890.273v-260.273h-332.955v-277.227h65.364v211.955h600.546v-211.955h65.273v277.227h-332.955v260.273z" />
<glyph unicode="&#xe900;" glyph-name="form-conditional" horiz-adv-x="1094" d="M300.535 125.162c0 3.87-1.548 7.739-4.335 10.525l-45.506 45.507 45.507 45.507c2.787 2.786 4.335 6.656 4.335 10.525s-1.548 7.739-4.335 10.525l-21.051 21.051c-2.787 2.786-6.655 4.334-10.525 4.334s-7.739-1.548-10.525-4.334l-45.507-45.507-45.507 45.507c-2.787 2.786-6.655 4.334-10.525 4.334s-7.739-1.548-10.525-4.334l-21.051-21.051c-2.787-2.786-4.335-6.656-4.335-10.525s1.548-7.739 4.335-10.525l45.507-45.507-45.507-45.507c-2.787-2.786-4.335-6.656-4.335-10.525s1.548-7.739 4.335-10.525l21.051-21.051c2.787-2.786 6.655-4.334 10.525-4.334s7.739 1.548 10.525 4.334l45.507 45.507 45.507-45.507c2.787-2.786 6.655-4.334 10.525-4.334s7.739 1.548 10.525 4.334l21.051 21.051c2.787 2.786 4.335 6.656 4.335 10.525zM999.093 237.227c0 3.87-1.548 7.739-4.335 10.525l-21.050 21.051c-2.787 2.786-6.655 4.334-10.525 4.334s-7.739-1.548-10.525-4.334l-101.54-101.694-45.507 45.662c-2.787 2.786-6.655 4.334-10.525 4.334s-7.739-1.548-10.525-4.334l-21.051-21.051c-2.787-2.786-4.335-6.656-4.335-10.525s1.548-7.739 4.335-10.525l77.083-77.083c2.787-2.786 6.655-4.334 10.525-4.334s7.739 1.548 10.525 4.334l133.116 133.116c2.787 2.786 4.335 6.656 4.335 10.525zM514.273 890.273v-260.273h-332.955v-277.227h65.364v211.955h600.546v-211.955h65.273v277.227h-332.955v260.273z" />
<glyph unicode="&#xe901;" glyph-name="folder-no-color" d="M194.559 846.275c-77.457-0.137-140.211-62.89-140.348-140.334v-515.869c0.137-77.457 62.892-140.211 140.336-140.348h634.893c77.457 0.137 140.211 62.892 140.348 140.336v396.602c0 77.561-62.808 140.453-140.336 140.59h-296.852l-47.104 62.885c-25.923 34.066-66.407 55.898-112 56.139h-178.937zM194.553 787.607h178.906c26.48-0.030 50.004-12.656 64.908-32.207l0.146-0.199 47.104-62.766 17.709-24.094h326.113c45.125-0.069 81.68-36.665 81.68-81.799v-396.471c-0.042-27.788-13.947-52.311-35.156-67.064l-725.621 651.525c12.744 8.239 27.912 13.050 44.211 13.074zM115.25 725.406l687.184-617.014h-607.875c-45.083 0.068-81.61 36.598-81.678 81.674v515.861c0.010 6.714 0.834 13.236 2.369 19.479z" />
<glyph unicode="&#xe902;" glyph-name="whiteboard" horiz-adv-x="878" d="M65.524 945.762c-29.444 0-53.333-23.889-53.333-53.333v-888.857c0-29.444 23.889-53.333 53.333-53.333h746.667c29.444 0 53.333 23.889 53.333 53.333v640c0 29.444-17.206 70.54-37.762 91.095l-173.333 173.333c-20.556 20.556-61.698 37.762-91.143 37.762h-497.762zM83.286 874.667h426.667v-231.095c0-29.444 23.889-53.333 53.333-53.333h231.143v-568.905h-711.143v853.333zM581.095 870.238c9.444-3.333 18.873-8.349 22.762-12.238l173.905-173.905c3.889-3.889 8.857-13.317 12.19-22.762h-208.857v208.905zM446.333 524.286c-17.277 0.517-34.937-1.027-52.952-4.571-22.15-4.43-42.984-11.806-62.476-22.143-19.492-10.632-37.062-23.776-52.714-39.429-15.357-15.357-28.321-32.794-38.952-52.286-10.632-19.196-18.189-39.85-22.619-62-7.974-41.346-5.87-79.57 6.238-114.714 12.404-35.144 30.421-65.145 54.048-89.952 23.626-24.512 50.629-42.977 81.048-55.381 30.714-12.108 60.087-15.954 88.143-11.524 18.31 2.658 31.188 12.718 38.571 30.143 7.679 17.72 7.364 34.709-0.905 50.952-10.337 20.082-9.623 39.575 2.19 58.476 11.813 19.196 29.117 28.762 51.857 28.762h70.429c15.948 0 29.539 5.635 40.762 16.857 11.222 11.518 16.81 25.243 16.81 41.19 0 34.849-7.51 67.353-22.571 97.476-14.766 29.828-34.707 55.089-59.809 75.762-24.808 20.673-53.599 35.559-86.381 44.714-16.538 4.578-33.438 7.15-50.714 7.667zM439 467.476c7.974 0 14.636-2.817 19.952-8.429 5.611-5.316 8.429-11.979 8.429-19.952s-2.817-14.77-8.429-20.381c-5.316-5.316-11.978-7.952-19.952-7.952s-14.77 2.636-20.381 7.952c-5.316 5.611-7.952 12.407-7.952 20.381s2.636 14.636 7.952 19.952c5.611 5.611 12.407 8.429 20.381 8.429zM325.619 410.762c7.974 0 14.589-2.817 19.905-8.429 5.611-5.316 8.429-11.979 8.429-19.952s-2.817-14.77-8.429-20.381c-5.316-5.316-11.931-7.952-19.905-7.952s-14.77 2.636-20.381 7.952c-5.316 5.611-8 12.407-8 20.381s2.684 14.636 8 19.952c5.611 5.611 12.407 8.429 20.381 8.429zM552.429 410.762c7.974 0 14.636-2.817 19.952-8.429 5.611-5.316 8.381-11.979 8.381-19.952s-2.77-14.77-8.381-20.381c-5.316-5.316-11.978-7.952-19.952-7.952s-14.77 2.636-20.381 7.952c-5.316 5.611-7.952 12.407-7.952 20.381s2.636 14.636 7.952 19.952c5.611 5.611 12.407 8.429 20.381 8.429zM297.238 297.333c7.974 0 14.636-2.77 19.952-8.381 5.611-5.316 8.429-11.978 8.429-19.952s-2.817-14.77-8.429-20.381c-5.316-5.316-11.979-8-19.952-8s-14.722 2.684-20.333 8c-5.316 5.611-8 12.407-8 20.381s2.684 14.636 8 19.952c5.611 5.611 12.359 8.381 20.333 8.381z" />
<glyph unicode="&#xe903;" glyph-name="new-template" horiz-adv-x="878" d="M65.524 945.762c-29.444 0-53.333-23.889-53.333-53.333v-888.857c0-29.444 23.889-53.333 53.333-53.333h746.667c29.444 0 53.333 23.889 53.333 53.333v640c0 29.444-17.206 70.54-37.762 91.095l-173.333 173.333c-20.556 20.556-61.698 37.762-91.143 37.762h-497.762zM83.286 874.667h426.667v-231.095c0-29.444 23.889-53.333 53.333-53.333h231.143v-568.905h-711.143v853.333zM581.095 870.238c9.444-3.333 18.873-8.349 22.762-12.238l173.905-173.905c3.889-3.889 8.857-13.317 12.19-22.762h-208.857v208.905zM414.476 490.857c-12.963 0-23.476-10.514-23.476-23.476v-101.762h-101.762c-12.963 0-23.476-10.514-23.476-23.476v-46.952c0-12.963 10.514-23.476 23.476-23.476h101.762v-101.762c0-12.963 10.514-23.476 23.476-23.476h46.952c12.963 0 23.476 10.514 23.476 23.476v101.762h101.762c12.963 0 23.476 10.514 23.476 23.476v46.952c0 12.963-10.514 23.476-23.476 23.476h-101.762v101.762c0 12.963-10.514 23.476-23.476 23.476h-46.952z" />
@ -39,4 +39,5 @@
<glyph unicode="&#xe91d;" glyph-name="form-list-ordered" horiz-adv-x="1094" d="M279.377 71.897c0 35.844-22.857 62.857-57.662 71.169l49.351 59.74v45.714h-172.987v-78.961h55.065v27.532c16.623 0 33.766 1.039 50.389 1.039v-0.52c-22.338-20.259-39.48-46.753-58.182-70.649l13.506-29.091c21.299 1.558 54.545 0 54.545-29.091 0-20.779-19.221-29.61-37.402-29.61-19.74 0-41.039 10.39-55.065 23.376l-29.61-45.714c23.377-23.377 56.623-34.286 89.35-34.286 54.026 0 98.701 32.208 98.701 89.35zM280.416 397.611h-54.545v-31.169h-65.974c1.558 40.519 114.285 57.662 114.285 134.545 0 51.428-41.558 80-89.87 80-39.48 0-74.805-20.26-91.948-56.104l44.156-30.649c8.831 14.545 23.896 30.13 42.078 30.13 17.143 0 28.052-9.351 28.052-27.013 0-43.636-117.402-58.182-117.402-154.285 0-9.351 1.558-18.701 3.117-28.052h188.051zM1012.362 231.897c0 9.351-7.792 16.623-16.623 16.623h-631.687c-9.351 0-16.623-7.273-16.623-16.623v-99.74c0-8.831 7.273-16.623 16.623-16.623h631.687c8.831 0 16.623 7.792 16.623 16.623zM280.936 698.908h-56.104v209.87h-55.065l-70.649-65.974 36.883-39.48c9.87 8.831 20.26 16.623 25.974 28.052h1.039v-6.234c0-42.078-0.52-84.156-0.52-126.233h-55.584v-51.428h174.025zM1012.362 497.87c0 9.351-7.792 16.623-16.623 16.623h-631.687c-9.351 0-16.623-7.273-16.623-16.623v-99.74c0-8.831 7.273-16.623 16.623-16.623h631.687c8.831 0 16.623 7.792 16.623 16.623zM1012.362 763.843c0 8.831-7.792 16.623-16.623 16.623h-631.687c-9.351 0-16.623-7.792-16.623-16.623v-99.74c0-8.831 7.273-16.623 16.623-16.623h631.687c8.831 0 16.623 7.792 16.623 16.623z" />
<glyph unicode="&#xe91e;" glyph-name="form-poll-maybe" horiz-adv-x="1094" d="M856.492 569.333c0 9.987-3.996 19.973-11.187 27.163l-54.325 54.327c-7.191 7.191-17.175 11.185-27.163 11.185s-19.972-3.995-27.163-11.185l-262.048-262.447-117.442 117.841c-7.191 7.19-17.175 11.185-27.163 11.185s-19.972-3.995-27.163-11.185l-54.327-54.327c-7.191-7.191-11.187-17.177-11.187-27.163s3.995-19.973 11.187-27.163l198.932-198.932c7.191-7.191 17.175-11.185 27.163-11.185s19.972 3.995 27.163 11.185l343.538 343.537c7.192 7.191 11.187 17.177 11.187 27.163zM65.903 444.364q0 120.454 35 225.454 35.454 105 101.818 184.090h73.636q-65.454-87.727-98.636-192.727-32.727-105-32.727-215.908 0-109.091 33.636-213.181t96.818-189.999h-72.727q-66.818 77.273-101.818 180.454t-35 221.818zM1027.916 444.364q0-119.545-35.454-222.727-35-103.182-101.363-179.545h-72.727q63.182 85.454 96.818 189.545 33.636 104.545 33.636 213.636 0 110.909-33.182 215.908-32.727 105-98.182 192.727h73.636q66.818-79.545 101.818-184.999 35-105 35-224.545z" />
<glyph unicode="&#xe91f;" glyph-name="destroy" horiz-adv-x="1094" d="M191.671 946.511c-28.024 0-50.742-22.731-50.742-50.756v-399.384h-74.822c-29.561-0.003-53.524-23.966-53.527-53.527 0.025-29.545 23.982-53.484 53.527-53.487h174.773l-88.853-95.929 95.929-104.66-95.835-104.524 121.3-132.182 43.855 55.423-70.369 76.813 95.781 104.471-95.687 104.364 89.122 96.225h190.445l-88.853-95.929 95.929-104.66-95.781-104.524 121.246-132.182 43.855 55.423-70.369 76.813 95.781 104.471-95.687 104.364 89.122 96.225h190.445l-88.853-95.929 95.983-104.66-95.835-104.524 121.286-132.182 43.815 55.423-70.383 76.759 95.835 104.524-95.727 104.417 89.122 96.171h117.318c29.55-0.004 53.515 23.936 53.54 53.487-0.003 29.566-23.974 53.531-53.54 53.527h-71.728v162.501c0 28.024-16.394 67.15-35.958 86.714l-164.966 164.966c-19.564 19.564-58.69 35.958-86.714 35.958zM208.607 878.832h406.073v-219.96c0-28.024 22.745-50.769 50.769-50.769h219.96v-111.732h-676.802zM682.359 874.608c8.989-3.172 17.984-7.936 21.685-11.636l165.505-165.505c3.702-3.7 8.463-12.696 11.636-21.685h-198.826z" />
<glyph unicode="&#xe920;" glyph-name="drive" horiz-adv-x="878" d="M586.884 124.372c0 23.946-19.592 43.537-43.537 43.537s-43.537-19.592-43.537-43.537c0-23.946 19.592-43.537 43.537-43.537s43.537 19.592 43.537 43.537zM726.203 124.372c0 23.946-19.592 43.537-43.537 43.537s-43.537-19.592-43.537-43.537c0-23.946 19.592-43.537 43.537-43.537s43.537 19.592 43.537 43.537zM787.155 37.298c0-9.252-8.163-17.415-17.415-17.415h-661.767c-9.252 0-17.415 8.163-17.415 17.415v174.149c0 9.252 8.163 17.415 17.415 17.415h661.767c9.252 0 17.415-8.163 17.415-17.415zM117.77 298.521l85.442 262.312c2.721 9.252 13.061 16.326 22.857 16.326h425.577c9.796 0 20.136-7.075 22.857-16.326l85.442-262.312zM856.815 211.447c0 14.694-4.354 27.211-8.707 40.816l-107.211 329.795c-12.517 38.095-48.979 64.762-89.251 64.762h-425.577c-40.272 0-76.734-26.667-89.251-64.762l-107.211-329.795c-4.354-13.605-8.707-26.122-8.707-40.816v-174.149c0-47.891 39.184-87.075 87.075-87.075h661.767c47.891 0 87.075 39.184 87.075 87.075z" />
</font></defs></svg>

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 41 KiB

@ -1,10 +1,10 @@
@font-face {
font-family: 'cptools';
src: url('fonts/cptools.eot?6tk5ck');
src: url('fonts/cptools.eot?6tk5ck#iefix') format('embedded-opentype'),
url('fonts/cptools.ttf?6tk5ck') format('truetype'),
url('fonts/cptools.woff?6tk5ck') format('woff'),
url('fonts/cptools.svg?6tk5ck#cptools') format('svg');
src: url('fonts/cptools.eot?pmxg4b');
src: url('fonts/cptools.eot?pmxg4b#iefix') format('embedded-opentype'),
url('fonts/cptools.ttf?pmxg4b') format('truetype'),
url('fonts/cptools.woff?pmxg4b') format('woff'),
url('fonts/cptools.svg?pmxg4b#cptools') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
@ -26,6 +26,9 @@
-moz-osx-font-smoothing: grayscale;
}
.cptools-drive:before {
content: "\e920";
}
.cptools-form-conditional:before {
content: "\e900";
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

@ -1,85 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 200 200"
version="1.1"
id="svg1039"
sodipodi:docname="logo_XWiki.svg"
width="200"
height="200"
inkscape:version="1.0.1 (1.0.1+r73)">
<metadata
id="metadata1043">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Logo_XWiki</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1900"
inkscape:window-height="1036"
id="namedview1041"
showgrid="false"
inkscape:zoom="0.91088486"
inkscape:cx="167.36695"
inkscape:cy="130.64123"
inkscape:window-x="10"
inkscape:window-y="10"
inkscape:window-maximized="0"
inkscape:current-layer="svg1039" />
<defs
id="defs1015">
<style
id="style1013">.cls-1{fill:#f78d1e;}.cls-2{fill:#008fd4;}.cls-3{fill:#ed1c24;}.cls-4{fill:#8cc63f;}.cls-5{fill:#626366;}</style>
</defs>
<title
id="title1017">Logo_XWiki</title>
<g
id="Layer_2"
data-name="Layer 2"
transform="translate(4.045,3.625)">
<g
id="Layer_1-2"
data-name="Layer 1">
<path
class="cls-2"
d="m 36.1,103.1 a 6.75,6.75 0 0 0 6.74,-6.75 v 0 A 6.75,6.75 0 0 0 36.1,89.6 H 6.75 A 6.75,6.75 0 0 0 0,96.35 v 0 a 6.75,6.75 0 0 0 6.75,6.75 z"
id="path1027" />
<path
class="cls-3"
d="m 89.6,156.61 a 6.75,6.75 0 0 1 6.75,-6.75 v 0 a 6.75,6.75 0 0 1 6.75,6.75 V 186 a 6.75,6.75 0 0 1 -6.75,6.75 v 0 A 6.75,6.75 0 0 1 89.6,186 Z"
id="path1029" />
<path
class="cls-4"
d="M 89.6,6.74 A 6.75,6.75 0 0 1 96.35,0 v 0 a 6.75,6.75 0 0 1 6.75,6.74 v 29.35 a 6.75,6.75 0 0 1 -6.75,6.75 v 0 A 6.75,6.75 0 0 1 89.6,36.09 Z"
id="path1031" />
<path
class="cls-5"
d="M 112.36,96 169.08,30.09 A 12.044,12.044 0 1 0 150.82,14.38 L 96.47,77.5 42.12,14.34 A 12.044,12.044 0 1 0 23.86,30.05 L 80.58,96 23.86,161.87 a 12.047261,12.047261 0 1 0 18.26,15.72 l 54.35,-63.16 54.35,63.16 a 12.047261,12.047261 0 0 0 18.26,-15.72 z"
id="path1033" />
<path
class="cls-1"
d="m 185.17,103.25 a 6.75,6.75 0 0 0 6.74,-6.75 v 0 a 6.75,6.75 0 0 0 -6.74,-6.75 h -29.35 a 6.75,6.75 0 0 0 -6.75,6.75 v 0 a 6.75,6.75 0 0 0 6.75,6.75 z"
id="path1035" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.0 KiB

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="568px" height="163px" viewBox="0 0 568 163" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 54 (76480) - https://sketchapp.com -->
<title>logo-footer</title>
<desc>Created with Sketch.</desc>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="logo-footer" fill-rule="nonzero">
<path d="M464.88,53.13 C457.35,53.13 453.78,66.49 456.06,86.23 C458.82,110.26 480.26,110.18 494.78,104.1 L494.76,115.96 C485.84,118.39 478.56,119 472.26,119 C435.66,119 431.93,88.9 431.93,79.9 C431.93,64.62 437.35,43.5 466.36,43.5 C485.6,43.5 496.58,56.02 496.76,72.8 L473.6,72.8 C473.56,62.33 471.36,53.16 464.88,53.16 L464.88,53.13 Z M542.58,70.35 L542.58,68.85 C542.28,61.51 540.78,53.12 534.48,53.12 C528.4,53.12 526.34,60.15 525.48,69.88 L525.43,70.34 L542.57,70.34 L542.58,70.35 Z M567.04,80.85 L525.17,80.85 L525.19,81.29 C526.69,110.89 548.71,110.26 564.25,104.09 L564.24,115.97 C555.34,118.4 549.14,119.01 542.26,119.01 C506.66,119.01 501.36,92.58 501.36,79.06 C501.36,63.43 508.16,43.46 535.36,43.49 C555.43,43.5 567.04,56.16 567.04,73.73 L567.04,80.83 L567.04,80.85 Z M316.68,106.77 L316.6,78.87 L316.14,78.91 C310.14,79.44 301.34,82.14 301.34,94.24 C301.33,105.56 306.84,106.54 312.09,106.76 L316.69,106.77 L316.68,106.77 Z M340.85,116.77 L301.72,116.76 C287.3,116.74 276.92,110.88 276.94,94.9 C276.96,81.9 284.48,75.64 293.16,72.6 C297.51,71.08 302.14,70.38 306.26,70.05 C310.38,69.72 313.96,69.78 316.18,69.77 L316.6,69.77 L316.6,67.51 C316.62,50.79 299.93,52.58 290.5,55.33 C288.7,55.88 287.07,56.46 285.7,57.03 L285.7,46.1 C294.03,44.14 299.7,43.47 308.55,43.47 C329.48,43.47 340.85,53.29 340.85,69.7 L340.85,116.76 L340.85,116.77 Z M276.5,53.94 C270.78,54.2 262,56.24 262,69.6 L261.96,116.77 L237.7,116.77 L237.73,68.83 C237.75,54.43 250.93,43.48 271.56,43.48 L276.48,43.48 L276.49,53.94 L276.5,53.94 Z M237.35,16.04 L237.34,26.31 L230.27,26.49 C227.84,26.69 225.53,27.09 223.53,27.91 C219.45,29.61 216.73,33.06 216.73,39.88 L216.73,45.93 L233.83,45.93 L233.82,56.33 L216.68,56.33 L216.7,116.77 L192.47,116.77 L192.47,45.47 C192.47,19.12 210.54,16.03 232.44,16.03 L237.34,16.03 L237.35,16.04 Z M421.15,116.78 L396.77,116.78 L396.72,74.1 C396.72,57.28 390.34,56.4 381.46,56.35 L379.74,56.35 L379.76,116.78 L355.46,116.78 L355.44,45.6 C357.41,45.73 363.98,45.94 385.89,45.94 C421.02,45.94 421.12,62.24 421.13,75.49 L421.14,116.79 L421.15,116.78 Z M164.83,162.76 C156.21,162.76 149.23,155.76 149.23,147.13 C149.23,138.5 156.23,131.5 164.83,131.5 C173.43,131.5 180.43,138.5 180.43,147.13 C180.43,155.76 173.43,162.76 164.83,162.76 Z" id="Shape" fill="#FFCD00"></path>
<path d="M176.97,45.92 L176.93,116.77 L152.68,116.77 L152.7,45.92 L176.97,45.92 Z M164.83,31.28 C156.21,31.28 149.23,24.28 149.23,15.66 C149.23,7.04 156.23,0.03 164.83,0.03 C173.43,0.03 180.43,7.03 180.43,15.66 C180.43,24.29 173.43,31.28 164.83,31.28 Z M41.2,80.5 C41.2,65.04 37.6,55.52 26.48,55.52 L24.48,55.52 L24.48,107 L26.83,107 C37.63,107 41.19,96.7 41.19,80.5 L41.2,80.5 Z M0.1,116.76 L0.1,16.03 L24.48,16.03 L24.47,45.93 L32.19,45.93 C49.09,45.93 57.44,52.53 61.59,60.1 C65.79,67.72 65.79,76.4 65.79,80.68 C65.79,91.92 62.24,116.78 34.39,116.78 L0.09,116.76 L0.1,116.76 Z M100.8,55.5 L100.8,107 L102.8,107 C113.93,107 117.5,97.48 117.5,82 C117.5,65.82 113.93,55.5 103.14,55.5 L100.8,55.5 L100.8,55.5 Z M142.12,82.02 C142.12,86.29 142.12,94.98 137.92,102.6 C133.75,110.17 125.4,116.77 108.52,116.77 L100.8,116.77 L100.8,146.67 L76.43,146.67 L76.43,45.929997 L110.73,45.93 C138.59,45.92 142.13,70.78 142.13,82.03 L142.12,82.02 Z" id="Shape" fill="#5E514D"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 KiB

@ -1,75 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="190px" height="80px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
<g transform="matrix(0.47619,0,0,0.47619,0.0952381,0)">
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M446.603,73.881L449.102,60.236L436.207,60.236L439.955,40.144L424.512,46.192L422.013,60.236L412.616,60.236L410.117,73.881L419.364,73.881L416.215,91.174C416.065,92.124 415.815,93.523 415.565,95.322C415.315,97.122 415.165,98.721 415.165,100.07C415.215,106.318 416.715,111.466 419.664,115.514C422.612,119.663 427.41,122.112 434.108,122.861L440.555,109.567C437.107,109.117 434.508,107.767 432.658,105.468C430.809,103.119 429.909,100.17 429.909,96.572C429.909,95.872 430.009,94.873 430.159,93.523C430.309,92.174 430.459,91.074 430.609,90.224L433.608,73.881L446.603,73.881Z" style="fill:rgb(152,192,0);fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M310.707,72.332C313.106,71.482 315.205,71.032 316.955,71.032C318.854,71.032 320.453,71.582 321.753,72.681C323.002,73.731 323.602,75.28 323.602,77.43C323.602,78.029 323.502,78.929 323.302,80.178C323.102,81.328 322.952,82.378 322.802,83.277L319.204,100.17C318.954,101.47 318.704,102.819 318.454,104.219C318.204,105.668 318.104,106.918 318.104,107.967C318.104,112.016 319.204,115.414 321.453,118.113C323.602,120.812 327.451,122.412 332.998,122.861L339.346,110.016C337.197,109.667 335.647,108.867 334.698,107.617C333.698,106.418 333.198,104.719 333.198,102.569C333.198,102.07 333.248,101.47 333.348,100.82C333.398,100.17 333.498,99.621 333.548,99.221L337.197,82.028C337.497,80.578 337.747,79.129 337.947,77.679C338.146,76.28 338.246,74.881 338.246,73.531C338.246,68.583 336.797,64.585 333.898,61.636C330.949,58.687 326.851,57.188 321.603,57.188C318.554,57.188 315.655,57.687 312.807,58.687C310.008,59.637 306.609,61.236 302.661,63.585C302.511,62.636 302.161,61.486 301.661,60.186C301.111,58.937 300.512,57.837 299.862,56.838L286.467,62.586C287.617,64.335 288.516,66.184 289.066,68.083C289.566,69.983 289.816,71.782 289.816,73.431C289.816,74.281 289.766,75.33 289.616,76.48C289.516,77.63 289.366,78.529 289.216,79.179L281.269,121.512L295.664,121.512L304.11,75.83C306.159,74.281 308.358,73.131 310.708,72.332L310.707,72.332Z" style="fill:rgb(152,192,0);fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M350.741,80.078C349.192,84.677 348.442,89.575 348.442,94.723C348.442,99.221 349.042,103.219 350.191,106.718C351.341,110.216 352.99,113.165 355.089,115.514C357.139,117.913 359.688,119.713 362.636,120.962C365.585,122.212 368.884,122.861 372.483,122.861C376.831,122.861 381.129,122.062 385.427,120.462C389.776,118.863 393.574,116.364 396.823,113.015L391.425,100.52C388.926,103.319 386.177,105.418 383.128,106.868C380.079,108.317 377.031,109.017 374.032,109.017C370.533,109.017 367.784,107.917 365.785,105.718C363.836,103.469 362.836,100.67 362.836,97.372L362.836,96.422C362.836,96.022 362.886,95.622 362.986,95.222C365.635,94.873 368.634,94.423 371.983,93.823C375.331,93.223 378.73,92.523 382.179,91.724C385.627,90.874 388.976,89.925 392.275,88.925C395.523,87.925 398.422,86.876 400.871,85.826L400.871,80.079C400.871,76.53 400.321,73.331 399.222,70.482C398.072,67.733 396.573,65.334 394.624,63.285C392.674,61.286 390.325,59.787 387.676,58.787C385.077,57.737 382.229,57.188 379.18,57.188C374.732,57.188 370.583,58.187 366.835,60.137C363.036,62.086 359.788,64.785 357.139,68.233C354.39,71.632 352.291,75.58 350.741,80.079L350.741,80.078ZM372.382,69.982C373.932,69.133 375.681,68.733 377.63,68.733C380.279,68.733 382.478,69.583 384.228,71.332C385.977,73.031 386.877,75.58 386.877,79.029C385.427,79.479 383.728,80.028 381.729,80.578C379.68,81.078 377.63,81.578 375.531,82.028C373.382,82.478 371.333,82.927 369.284,83.327C367.235,83.677 365.485,83.977 363.986,84.227C364.236,82.128 364.686,80.128 365.385,78.279C366.135,76.43 367.085,74.781 368.234,73.381C369.484,71.982 370.833,70.832 372.383,69.983L372.382,69.982Z" style="fill:rgb(152,192,0);fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M404.17,140.454C404.17,139.205 403.97,138.055 403.57,137.056C403.17,136.056 402.62,135.206 401.971,134.457C401.271,133.757 400.471,133.207 399.522,132.857C398.572,132.507 397.522,132.308 396.423,132.308C394.973,132.308 393.624,132.607 392.374,133.157C391.125,133.707 390.025,134.507 389.076,135.506C388.126,136.506 387.376,137.655 386.827,139.005C386.277,140.354 385.977,141.804 385.977,143.403C385.977,144.653 386.177,145.752 386.577,146.802C386.927,147.801 387.476,148.651 388.176,149.351C388.826,150.1 389.676,150.65 390.625,151.05C391.575,151.4 392.624,151.6 393.774,151.6C395.173,151.6 396.523,151.3 397.772,150.75C399.022,150.2 400.121,149.401 401.071,148.401C402.021,147.451 402.77,146.252 403.32,144.902C403.87,143.553 404.17,142.054 404.17,140.454ZM390.275,140.404C390.575,139.505 390.975,138.705 391.475,138.005C392.025,137.306 392.674,136.756 393.424,136.306C394.174,135.856 394.973,135.656 395.923,135.656C397.372,135.656 398.422,136.106 399.172,137.006C399.921,137.855 400.321,139.105 400.321,140.654C400.321,141.604 400.171,142.553 399.871,143.503C399.622,144.403 399.222,145.202 398.672,145.902C398.122,146.602 397.472,147.152 396.723,147.601C395.973,148.001 395.123,148.201 394.224,148.201C392.774,148.201 391.725,147.751 390.975,146.902C390.225,146.002 389.826,144.803 389.826,143.253C389.826,142.304 389.975,141.354 390.275,140.404Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M434.558,132.557L431.009,132.557L429.11,143.603C429.06,143.753 429.01,144.003 429.01,144.353C429.01,144.703 429.01,144.952 429.01,145.202L428.86,145.202L422.463,132.557L419.114,132.557L415.765,151.3L419.364,151.3L421.363,140.004C421.413,139.855 421.413,139.605 421.413,139.355C421.413,139.105 421.413,138.805 421.413,138.505L421.563,138.505L428.11,151.45L431.309,151.15L434.558,132.557Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M374.382,132.557L370.733,132.557L367.384,151.3L371.083,151.3L374.382,132.557Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M328.95,132.557L324.702,132.557C323.902,133.907 323.052,135.456 322.103,137.106C321.153,138.755 320.253,140.454 319.354,142.154C318.454,143.853 317.654,145.502 316.905,147.102C316.155,148.701 315.555,150.1 315.105,151.3L318.954,151.3C319.104,150.95 319.254,150.5 319.454,150.05C319.654,149.601 319.854,149.101 320.104,148.651C320.303,148.201 320.503,147.751 320.703,147.302C320.903,146.852 321.103,146.452 321.253,146.102L327.75,146.102C327.8,146.552 327.8,147.002 327.85,147.501L328,148.951C328.05,149.401 328.1,149.851 328.15,150.3C328.2,150.75 328.2,151.1 328.2,151.45L331.899,151.15C331.899,150.45 331.849,149.651 331.749,148.701C331.699,147.751 331.549,146.752 331.399,145.702C331.249,144.653 331.099,143.503 330.899,142.354C330.749,141.204 330.549,140.054 330.3,138.905C330.1,137.755 329.9,136.656 329.65,135.556C329.4,134.507 329.2,133.507 328.95,132.557ZM326.601,138.105C326.701,138.655 326.801,139.255 326.901,139.904C327.001,140.504 327.101,141.104 327.151,141.654C327.251,142.204 327.301,142.603 327.351,142.953L322.702,142.953C322.952,142.503 323.202,142.004 323.452,141.454C323.752,140.904 324.052,140.304 324.352,139.705C324.702,139.105 325.002,138.555 325.301,138.005C325.601,137.455 325.851,136.956 326.101,136.606L326.301,136.606C326.401,137.006 326.501,137.505 326.601,138.105Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M357.638,135.956L358.188,132.557L345.393,132.557L344.844,135.956L349.392,135.956L346.743,151.3L350.391,151.3L353.09,135.956L357.638,135.956Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M297.462,132.308C296.413,132.308 295.363,132.358 294.314,132.457C293.264,132.607 292.265,132.757 291.315,133.007L288.166,150.85C289.116,151.1 290.215,151.25 291.415,151.4C292.565,151.55 293.664,151.6 294.714,151.6C296.263,151.6 297.662,151.35 299.012,150.85C300.361,150.3 301.561,149.601 302.561,148.651C303.56,147.701 304.36,146.552 304.96,145.202C305.509,143.853 305.809,142.304 305.809,140.604C305.809,139.255 305.609,138.105 305.21,137.056C304.76,136.006 304.21,135.156 303.46,134.457C302.711,133.757 301.811,133.207 300.811,132.857C299.762,132.507 298.662,132.308 297.463,132.308L297.462,132.308ZM296.663,135.706C297.413,135.706 298.112,135.806 298.762,135.956C299.412,136.106 299.962,136.406 300.411,136.806C300.911,137.206 301.311,137.705 301.561,138.355C301.811,138.955 301.961,139.705 301.961,140.654C301.961,141.854 301.811,142.903 301.461,143.853C301.161,144.803 300.711,145.602 300.112,146.252C299.512,146.902 298.812,147.352 297.962,147.701C297.113,148.051 296.213,148.201 295.164,148.201C294.714,148.201 294.264,148.201 293.714,148.151C293.164,148.101 292.665,148.051 292.315,148.001L294.464,135.906C294.764,135.856 295.164,135.806 295.613,135.756C296.063,135.706 296.413,135.706 296.663,135.706Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M185.807,62.585C186.957,64.335 187.856,66.184 188.406,68.083C188.906,69.982 189.156,71.782 189.156,73.431C189.156,74.281 189.106,75.33 188.956,76.48C188.856,77.629 188.706,78.529 188.556,79.179L180.609,121.512L195.003,121.512L203.45,75.83C205.499,74.281 207.698,73.131 210.047,72.332C212.446,71.482 214.546,71.032 216.295,71.032C218.194,71.032 219.794,71.582 221.093,72.681C222.343,73.731 222.942,75.28 222.942,77.43C222.942,78.029 222.842,78.929 222.642,80.178C222.443,81.328 222.293,82.378 222.143,83.277L218.544,100.17C218.294,101.47 218.044,102.819 217.794,104.219C217.545,105.668 217.445,106.918 217.445,107.967C217.445,112.016 218.544,115.414 220.793,118.113C222.942,120.812 226.791,122.412 232.339,122.861L238.686,110.016C236.537,109.667 234.988,108.867 234.038,107.617C233.038,106.418 232.539,104.719 232.539,102.569C232.539,102.07 232.589,101.47 232.689,100.82C232.739,100.17 232.839,99.621 232.889,99.221L236.537,82.028C236.837,80.578 237.087,79.129 237.287,77.679C237.487,76.28 237.587,74.881 237.587,73.531C237.587,68.583 236.137,64.585 233.238,61.636C230.29,58.687 226.191,57.188 220.943,57.188C217.895,57.188 214.996,57.687 212.147,58.687C209.348,59.637 205.949,61.236 202.001,63.585C201.851,62.636 201.501,61.486 201.001,60.186C200.452,58.937 199.852,57.837 199.202,56.838L185.807,62.586L185.807,62.585Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M276.821,31.548L262.676,31.548L251.881,90.024C251.431,91.974 251.081,94.023 250.831,96.172C250.581,98.271 250.431,100.22 250.431,102.02C250.431,107.817 251.531,112.565 253.78,116.264C256.029,119.963 259.828,122.162 265.175,122.861L271.673,109.567C270.623,109.067 269.724,108.517 268.874,107.917C268.024,107.368 267.325,106.618 266.775,105.768C266.175,104.919 265.725,103.919 265.475,102.719C265.225,101.52 265.076,100.02 265.076,98.271C265.076,97.422 265.126,96.472 265.225,95.472C265.375,94.423 265.525,93.373 265.675,92.274L276.821,31.548Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M246.433,132.557L242.784,132.557L240.385,146.252C239.886,146.802 239.286,147.252 238.536,147.651C237.786,148.001 236.987,148.201 236.087,148.201C235.187,148.201 234.488,148.001 233.988,147.601C233.438,147.152 233.188,146.452 233.188,145.402C233.188,145.202 233.238,144.902 233.288,144.503C233.338,144.153 233.338,143.803 233.388,143.503L235.387,132.557L231.689,132.557L229.74,143.453C229.69,143.903 229.64,144.353 229.59,144.803C229.54,145.252 229.54,145.602 229.54,145.952C229.54,146.952 229.69,147.801 229.99,148.551C230.289,149.301 230.689,149.851 231.189,150.3C231.739,150.75 232.339,151.1 232.988,151.3C233.688,151.5 234.388,151.6 235.138,151.6C236.987,151.6 238.636,151.05 240.136,149.9C240.136,150.15 240.136,150.45 240.186,150.75C240.186,151 240.186,151.25 240.236,151.5L243.884,151.25C243.834,151 243.834,150.75 243.834,150.45C243.784,150.2 243.784,149.9 243.784,149.551C243.784,148.951 243.834,148.301 243.884,147.651C243.934,146.952 243.984,146.302 244.134,145.702L246.433,132.557Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M276.621,132.557L273.072,132.557L271.173,143.603C271.123,143.753 271.073,144.003 271.073,144.353C271.073,144.703 271.073,144.952 271.073,145.202L270.923,145.202L264.526,132.557L261.177,132.557L257.828,151.3L261.427,151.3L263.426,140.004C263.476,139.855 263.476,139.605 263.476,139.355C263.476,139.105 263.476,138.805 263.476,138.505L263.626,138.505L270.174,151.45L273.372,151.15L276.621,132.557Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M214.796,134.457C214.096,133.757 213.296,133.207 212.347,132.857C211.397,132.507 210.347,132.308 209.248,132.308C207.798,132.308 206.449,132.607 205.199,133.157C203.95,133.707 202.85,134.507 201.901,135.506C200.951,136.506 200.201,137.655 199.652,139.005C199.102,140.354 198.802,141.804 198.802,143.403C198.802,144.653 199.002,145.752 199.402,146.802C199.752,147.801 200.301,148.651 201.001,149.351C201.651,150.1 202.5,150.65 203.45,151.05C204.4,151.4 205.449,151.6 206.599,151.6C207.998,151.6 209.348,151.3 210.597,150.75C211.847,150.2 212.946,149.401 213.896,148.401C214.846,147.451 215.595,146.252 216.145,144.902C216.695,143.553 216.995,142.054 216.995,140.454C216.995,139.205 216.795,138.055 216.395,137.056C215.995,136.056 215.445,135.206 214.796,134.457ZM204.3,138.005C204.85,137.306 205.499,136.756 206.249,136.306C206.999,135.856 207.798,135.656 208.748,135.656C210.197,135.656 211.247,136.106 211.997,137.006C212.746,137.855 213.146,139.105 213.146,140.654C213.146,141.604 212.996,142.553 212.696,143.503C212.447,144.403 212.047,145.202 211.497,145.902C210.947,146.602 210.297,147.152 209.548,147.601C208.798,148.001 207.948,148.201 207.049,148.201C205.599,148.201 204.55,147.751 203.8,146.902C203.05,146.002 202.65,144.803 202.65,143.253C202.65,142.304 202.8,141.354 203.1,140.404C203.4,139.505 203.8,138.705 204.3,138.005Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M188.256,132.557L177.96,132.557L174.612,151.3L178.31,151.3L179.56,144.153L186.307,144.153L186.907,140.754L180.159,140.754L181.009,135.956L187.656,135.956L188.256,132.557Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M127.081,44.893C128.43,33.947 125.681,24.101 118.884,15.404C112.087,6.708 103.19,1.66 92.245,0.31C81.299,-1.039 71.453,1.71 62.756,8.507C54.71,14.755 49.812,22.801 48.062,32.647C47.912,33.497 47.762,34.297 47.662,35.146C47.562,35.996 47.512,36.796 47.463,37.595C47.113,42.194 47.562,46.592 48.762,50.79C50.111,55.688 52.461,60.286 55.859,64.635C59.258,68.983 63.156,72.382 67.604,74.931C71.353,77.08 75.501,78.529 80.049,79.329C80.849,79.479 81.649,79.579 82.498,79.729C82.948,79.779 83.398,79.829 83.848,79.879C84.948,75.43 86.647,71.282 88.996,67.533C87.447,67.583 85.847,67.533 84.248,67.384C84.148,67.334 84.098,67.334 84.048,67.334C82.199,67.084 80.399,66.734 78.75,66.184C73.602,64.535 69.254,61.486 65.705,56.938C62.157,52.39 60.257,47.442 59.908,42.044C59.808,40.294 59.858,38.545 60.107,36.696C60.107,36.646 60.107,36.546 60.107,36.496C61.057,29.049 64.506,23.001 70.453,18.353C76.451,13.705 83.198,11.806 90.745,12.755C98.292,13.655 104.39,17.104 109.038,23.101C113.686,29.099 115.585,35.846 114.686,43.393C114.436,45.093 114.136,46.692 113.686,48.241C117.884,46.892 122.283,46.192 126.881,46.242C126.931,45.792 127.031,45.342 127.081,44.893Z" style="fill:rgb(152,192,0);fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M132.329,51.49C131.479,51.39 130.679,51.29 129.83,51.24C125.231,50.94 120.833,51.39 116.635,52.539C111.737,53.889 107.139,56.288 102.79,59.687C98.442,63.035 95.043,66.934 92.544,71.382C90.395,75.13 88.946,79.279 88.096,83.827C92.445,84.577 96.443,85.826 100.141,87.675C100.391,85.876 100.741,84.177 101.241,82.577C102.89,77.43 105.939,73.081 110.487,69.533C115.035,65.984 119.983,64.035 125.431,63.685C127.181,63.585 128.93,63.635 130.779,63.885C130.829,63.885 130.879,63.885 130.929,63.885C138.376,64.835 144.424,68.333 149.072,74.281C153.77,80.228 155.669,86.976 154.72,94.523C153.77,102.07 150.321,108.167 144.374,112.865C138.426,117.514 131.679,119.363 124.232,118.463C125.081,122.512 125.331,126.76 125.031,131.158C134.977,131.808 143.974,128.959 152.021,122.711C160.717,115.914 165.765,107.018 167.115,96.072C168.464,85.127 165.715,75.28 158.918,66.584C152.62,58.537 144.574,53.639 134.778,51.89C133.928,51.74 133.128,51.59 132.329,51.49Z" style="fill:rgb(152,192,0);fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M128.93,78.729C125.481,78.329 122.432,79.179 119.684,81.328C116.935,83.477 115.385,86.226 114.985,89.625C114.536,93.073 115.385,96.122 117.534,98.871C119.684,101.62 122.432,103.169 125.881,103.569C129.28,104.019 132.329,103.169 135.077,101.02C137.826,98.871 139.376,96.122 139.826,92.673C140.225,89.275 139.376,86.226 137.227,83.477C135.077,80.728 132.329,79.179 128.93,78.729Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M12.826,73.631C13.776,66.084 17.225,59.936 23.222,55.288C29.17,50.64 35.867,48.741 43.314,49.691C42.465,45.642 42.165,41.394 42.514,36.996C32.568,36.346 23.572,39.145 15.525,45.442C6.779,52.24 1.781,61.136 0.431,72.082C-0.917,83.027 1.781,92.823 8.628,101.57C14.876,109.617 22.922,114.515 32.768,116.264C33.568,116.414 34.368,116.514 35.217,116.664C36.067,116.764 36.867,116.864 37.716,116.914C42.315,117.214 46.713,116.764 50.911,115.614C55.759,114.215 60.407,111.816 64.756,108.467C69.054,105.068 72.453,101.17 75.001,96.772C77.151,93.023 78.6,88.875 79.45,84.327C75.101,83.577 71.103,82.278 67.405,80.478C67.155,82.228 66.805,83.927 66.305,85.576C64.656,90.724 61.607,95.073 57.059,98.621C52.51,102.17 47.562,104.119 42.165,104.469C40.415,104.569 38.616,104.519 36.767,104.269C36.717,104.269 36.667,104.269 36.617,104.219C29.17,103.269 23.122,99.821 18.474,93.873C13.776,87.875 11.877,81.128 12.826,73.631Z" style="fill:rgb(152,192,0);fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M32.469,67.134C29.72,69.233 28.17,72.032 27.72,75.48C27.321,78.829 28.17,81.878 30.319,84.627C32.419,87.376 35.167,88.975 38.616,89.425C42.065,89.775 45.113,88.925 47.862,86.826C50.561,84.677 52.111,81.878 52.56,78.529C53.01,75.08 52.161,71.982 50.011,69.283C47.862,66.534 45.113,64.984 41.665,64.585C38.216,64.135 35.167,64.984 32.469,67.134Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M97.293,32.348C95.143,29.599 92.345,28.049 88.946,27.649C85.497,27.2 82.449,28.049 79.75,30.198C77.001,32.298 75.401,35.096 75.001,38.545C74.552,41.944 75.451,44.992 77.6,47.741C79.7,50.44 82.449,52.04 85.897,52.49C89.296,52.839 92.345,51.99 95.093,49.891C97.842,47.741 99.392,44.943 99.842,41.594C100.241,38.145 99.392,35.047 97.293,32.348Z" style="fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M85.047,88.425C84.598,88.375 84.148,88.325 83.698,88.275C82.598,92.723 80.899,96.872 78.55,100.62C80.099,100.52 81.699,100.57 83.348,100.77C83.398,100.77 83.448,100.77 83.498,100.82C85.347,101.02 87.097,101.37 88.796,101.92C93.944,103.569 98.292,106.668 101.841,111.216C105.389,115.714 107.289,120.662 107.638,126.11C107.738,127.859 107.688,129.609 107.439,131.458C107.439,131.508 107.439,131.558 107.439,131.658C106.489,139.105 103.04,145.152 97.093,149.801C91.095,154.449 84.348,156.348 76.801,155.398C69.254,154.449 63.156,151 58.508,145.052C53.81,139.055 51.911,132.308 52.86,124.761C53.06,123.061 53.41,121.462 53.91,119.912C49.662,121.262 45.263,121.912 40.665,121.912C40.615,122.362 40.515,122.811 40.465,123.261C39.116,134.207 41.815,144.003 48.662,152.749C55.459,161.446 64.356,166.494 75.301,167.843C86.247,169.192 96.043,166.444 104.79,159.647C112.836,153.349 117.734,145.302 119.484,135.456C119.634,134.657 119.734,133.857 119.884,133.007C119.933,132.158 120.033,131.358 120.083,130.558C120.383,125.91 119.933,121.512 118.784,117.364C117.434,112.465 115.035,107.867 111.687,103.519C108.288,99.171 104.39,95.722 99.991,93.223C96.193,91.074 92.045,89.625 87.496,88.825C86.697,88.675 85.897,88.525 85.047,88.425Z" style="fill:rgb(152,192,0);fill-rule:nonzero;"/>
</g>
<g transform="matrix(0.869481,0,0,0.869481,4.11434,10.9736)">
<path d="M89.995,120.412C87.846,117.663 85.097,116.114 81.649,115.664C78.2,115.264 75.151,116.114 72.453,118.263C69.704,120.412 68.154,123.161 67.704,126.56C67.255,130.008 68.154,133.057 70.303,135.806C72.403,138.555 75.151,140.104 78.6,140.504C82.049,140.954 85.097,140.104 87.846,137.955C90.545,135.806 92.095,133.057 92.544,129.609C92.944,126.21 92.095,123.161 89.995,120.412Z" style="fill-rule:nonzero;"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 22 KiB

@ -1,40 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title data-localization="main_title">CryptPad: Collaboration suite, encrypted and open-source</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" type="image/png" href="/customize/favicon/main-favicon.png" id="favicon"/>
<style>
html {
height: 100%;
}
body {
transition: opacity 0.75s, visibility 0s 0.75s;
visibility: visible;
position: fixed;
z-index: 10000000;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
background: linear-gradient(to right, #326599 0%, #326599 50%, #4591c4 50%, #4591c4 100%);
color: #fafafa;
font-size: 1.5em;
opacity: 1;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
font-family: monospace;
}
#cp-logo {
max-width: 300px;
}
</style>
</head>
<body class="html">
<img id="cp-logo" src="/customize/loading-logo.png">
<h1>Maintenance</h1>
<h3>We are currently upgrading CryptPad. We will be back shortly!</h3>

@ -5,7 +5,8 @@ define([
'/customize/messages.js',
'jquery',
'/api/config',
], function (h, Language, AppConfig, Msg, $, ApiConfig) {
'optional!/api/instance',
], function (h, Language, AppConfig, Msg, $, ApiConfig, Instance) {
var Pages = {};
Pages.setHTML = function (e, html) {
@ -73,25 +74,12 @@ define([
return select;
};
var footerCol = function (title, L, n) {
n = n || 3;
return h('div.col-sm-' + n, [
h('ul.list-unstyled', [
h('li.footer-title', {
'data-localization': title,
}, Msg[title])
].concat(L.map(function (l) {
return h('li', [ l ]);
}))
)
]);
};
var footLink = function (ref, loc, text) {
var footLink = function (ref, loc, text, icon) {
if (!ref) { return; }
var attrs = {
href: ref,
};
var iconName = '';
if (!/^\//.test(ref)) {
attrs.target = '_blank';
attrs.rel = 'noopener noreferrer';
@ -100,30 +88,29 @@ define([
attrs['data-localization'] = loc;
text = Msg[loc];
}
return h('a', attrs, text);
if (icon) {
iconName = 'i.fa.fa-' + icon;
icon = h(iconName);
}
return h('a', attrs, [icon, text]);
};
Pages.versionString = "v4.14.1";
Pages.versionString = "5.0.0";
var customURLs = Pages.customURLs = {};
(function () {
var defaultURLs = {
//imprint: '/imprint.html',
//privacy: '/privacy.html',
terms: '/terms.html',
//roadmap: '/roadmap.html',
source: 'https://github.com/xwiki-labs/cryptpad',
};
var l = Msg._getLanguage();
['imprint', 'privacy', 'terms', 'roadmap', 'source'].forEach(function (k) {
var value = AppConfig[k];
//console.log('links', k, value);
if (value === false) { return; }
if (value === true) {
customURLs[k] = defaultURLs[k];
return;
}
if (!value) { return; }
if (typeof(value) === 'string') {
customURLs[k] = value;
return;
@ -134,34 +121,41 @@ define([
});
var value = AppConfig.hostDescription;
Pages.hostDescription = (value && (value[l] || value.default)) || Msg.home_host;
Pages.Instance = {};
Object.keys(Instance).forEach(function (k) {
var value = Instance[k];
Pages.Instance[k] = value[l] || value.default || undefined;
});
var name;
try {
name = Pages.Instance.name || new URL('/', ApiConfig.httpUnsafeOrigin).host;
} catch (err) {
name = 'CryptPad';
}
Pages.Instance.name = name;
Pages.Instance.description = Pages.Instance.description || Msg.main_catch_phrase;
}());
// used for the about menu
Pages.imprintLink = footLink(customURLs.imprint, 'imprint');
Pages.privacyLink = footLink(customURLs.privacy, 'privacy');
Pages.termsLink = footLink(customURLs.terms, 'footer_tos');
Pages.termsLink = footLink(customURLs.terms, 'terms');
Pages.sourceLink = footLink(customURLs.source, 'footer_source');
Pages.docsLink = footLink('https://docs.cryptpad.fr', 'docs_link');
Pages.roadmapLink = footLink(customURLs.roadmap, 'footer_roadmap');
Pages.infopageFooter = function () {
var legalFooter;
// only display the legal part of the footer if it has content
if (Pages.termsLink || Pages.privacyLink || Pages.imprintLink) {
legalFooter = footerCol('footer_legal', [
Pages.termsLink,
Pages.privacyLink,
Pages.imprintLink,
]);
Pages.infopageFooter = function () {
var donateButton;
if (!ApiConfig.removeDonateButton) {
donateButton = footLink('https://opencollective.com/cryptpad/contribute/', 'footer_donate', null, 'money'); // XXX DB: add OpenCollective icon // XXX
}
var n = legalFooter ? 3: 4;
return h('footer', [
h('div.container', [
h('div.row', [
h('div.col-sm-' + n, [
return h('footer.cp-footer', [
h('div.cp-footer-left', [
h('a', {href:"https://cryptpad.org"}, [
h('div.cp-logo-foot', [
h('img', {
src: '/customize/CryptPad_logo.svg',
@ -171,26 +165,19 @@ define([
h('span.logo-font', 'CryptPad')
])
]),
footerCol('footer_product', [
footLink('/what-is-cryptpad.html', 'topbar_whatIsCryptpad'),
Pages.docsLink,
footLink('/features.html', Pages.areSubscriptionsAllowed()? 'pricing': 'features'), // Messages.pricing, Messages.features
Pages.sourceLink,
footLink('https://opencollective.com/cryptpad/contribute/', 'footer_donate'),
], n),
footerCol('footer_aboutUs', [
footLink('https://blog.cryptpad.fr/', 'blog'),
footLink('/contact.html', 'contact'),
footLink('https://github.com/xwiki-labs/cryptpad/wiki/Contributors', 'footer_team'),
footLink('http://www.xwiki.com', null, 'XWiki SAS'),
Pages.roadmapLink,
], n),
legalFooter,
h('span.cp-footer-version', 'v' + Pages.versionString)
]),
h('div.cp-footer-center', [
h('div.cp-logo-btns', [
footLink('https://cryptpad.org', null, Msg.footer_website, 'link'),
donateButton,
])
]),
h('div.cp-version-footer', [
languageSelector(),
h('span', "CryptPad " + Pages.versionString)
h('div.cp-footer-right', [
h('div.cp-footer-language', [
h('i.fa.fa-language', {'aria-hidden': 'true'}),
languageSelector()
])
])
]);
};
@ -201,89 +188,50 @@ define([
var registerLink;
if (!ApiConfig.restrictRegistration) {
registerLink = h('a.nav-item.nav-link.cp-register-btn', { href: '/register/'}, Msg.login_register);
registerLink = h('a.nav-item.nav-link.cp-register-btn', { href: '/register/'}, [
h('i.fa.fa-user', {'aria-hidden':'true'}),
Msg.login_register
]);
}
if (username === null) {
rightLinks = [
h('a.nav-item.nav-link.cp-login-btn', { href: '/login/'}, Msg.login_login),
h('a.nav-item.nav-link.cp-login-btn', { href: '/login/'}, [
h('i.fa.fa-sign-in', {'aria-hidden':'true'}),
Msg.login_login
]),
registerLink,
];
} else {
rightLinks = h('a.nav-item.nav-link.cp-user-btn', { href: '/drive/' }, [
h('i.fa.fa-user-circle'),
h('i.fa.fa-user-circle', {'aria-hidden':'true'}),
" ",
username
]);
}
var button = h('button.navbar-toggler', {
'type':'button',
/*'data-toggle':'collapse',
'data-target':'#menuCollapse',
'aria-controls': 'menuCollapse',
'aria-expanded':'false',
'aria-label':'Toggle navigation'*/
}, h('i.fa.fa-bars '));
$(button).click(function () {
if ($('#menuCollapse').is(':visible')) {
return void $('#menuCollapse').slideUp();
}
$('#menuCollapse').slideDown();
});
return h('nav.navbar.navbar-expand-lg',
h('a.navbar-brand', { href: '/index.html'}, [
var isHome = ['/', '/index.html'].includes(window.location.pathname);
var homeLink = h('a.nav-item.nav-link.cp-back-home' /* .navbar-brand */, { href: '/index.html' }, [
h('i.fa.fa-arrow-left'),
h('img', {
src: '/customize/CryptPad_logo.svg?',
'aria-hidden': true,
src: '/customize/CryptPad_logo.svg',
"aria-hidden": true,
alt: ''
}), 'CryptPad'
]),
button,
h('div.collapse.navbar-collapse.justify-content-end#menuCollapse', [
h('a.nav-item.nav-link', { href: '/what-is-cryptpad.html'}, Msg.about),
h('a.nav-item.nav-link', { href: 'https://docs.cryptpad.fr'}, Msg.docs_link),
h('a.nav-item.nav-link', { href: '/features.html'}, Pages.areSubscriptionsAllowed()? Msg.pricing: Msg.features),
].concat(rightLinks))
);
};
Pages.crowdfundingButton = function (onClick) {
var _link = h('a', {
href: "https://opencollective.com/cryptpad/",
target: '_blank',
rel: 'noopener',
});
var crowdFunding = h('button', [
Msg.crowdfunding_button
]);
$(crowdFunding).click(function () {
_link.click();
if (typeof(onClick) === 'function') { onClick(); }
});
return crowdFunding;
};
Pages.subscribeButton = function (onClick) {
var _link = h('a', {
href: AppConfig.upgradeURL || "/accounts/",
});
var subscribe = h('button', [
Msg.features_f_subscribe,
}),
Msg.homePage
]);
$(subscribe).click(function () {
_link.click();
if (typeof(onClick) === 'function') { onClick(); }
});
return subscribe;
return h('nav.navbar.navbar-expand-lg',
[
!isHome? homeLink: undefined,
h('a.nav-item.nav-link', { href: '/features.html'}, [
h('i.fa.fa-info-circle'),
Pages.areSubscriptionsAllowed()? Msg.pricing: Msg.features
]),
h('a.nav-item.nav-link', { href: 'https://docs.cryptpad.fr'},
[h('i.fa.fa-book', {'aria-hidden':'true'}),Msg.docs_link]),
].concat(rightLinks)
);
};
return Pages;

@ -23,8 +23,8 @@ define([
]),
(adminEmail || adminMailbox) ? h('div.row.cp-iconCont.align-items-center', [
h('div.col-12',
Pages.setHTML(h('h2.text-center'), Msg.contact_admin),
h('p', Msg.contact_adminHint)
h('h2.text-center', Msg._getKey('contact_admin', [ Pages.Instance.name ])),
h('p.center', Msg.contact_adminHint)
),
adminEmail ? h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "mailto:"+Config.adminEmail},
@ -58,24 +58,24 @@ define([
h('div.row.cp-iconCont.align-items-center', [
h('div.col-12',
Pages.setHTML(h('h2.text-center'), Msg.contact_dev),
h('p', Msg.contact_devHint)
h('p.center', Msg.contact_devHint)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "https://twitter.com/cryptpad"},
h('div',
h('a.card-small', {href : "https://matrix.to/#/#cryptpad:matrix.xwiki.com"},
h('div.card-body',
h('p', [
// this is not a typo. adblock plus blocks images with src *twitter* apparently
h('img', {
src: '/customize/images/twiitter.svg',
src: '/customize/images/sayhi.svg',
alt: '',
'aria-hidden': 'true'}),
'Twitter'
'aria-hidden': 'true'
}),
Msg.contact_chat || 'Chat'
])
)
)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "https://social.weho.st/@cryptpad"},
h('div',
h('a.card-small', {href : "https://social.weho.st/@cryptpad"},
h('div.card-body',
h('p', [
h('img', {
@ -88,35 +88,35 @@ define([
)
)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "https://github.com/xwiki-labs/cryptpad/issues/"},
h('div',
h('a.card-small', {href : "https://twitter.com/cryptpad"},
h('div.card-body',
h('p', [
// this is not a typo. adblock plus blocks images with src *twitter* apparently
h('img', {
src: '/customize/images/github.svg',
src: '/customize/images/twiitter.svg',
alt: '',
'aria-hidden': 'true'}),
Msg.contact_bug || 'Bug report'
'Twitter'
])
)
)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "https://matrix.to/#/#cryptpad:matrix.xwiki.com"},
h('div',
h('a.card-small', {href : "https://github.com/xwiki-labs/cryptpad/issues/"},
h('div.card-body',
h('p', [
h('img', {
src: '/customize/images/sayhi.svg',
src: '/customize/images/github.svg',
alt: '',
'aria-hidden': 'true'
}),
Msg.contact_chat || 'Chat'
'aria-hidden': 'true'}),
Msg.contact_bug || 'Bug report'
])
)
)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "mailto:" + developerEmail},
h('div',
h('a.card-small', {href : "mailto:" + developerEmail},
h('div.card-body',
h('p', [
h('img', {

@ -2,8 +2,6 @@ define([
'jquery',
'/api/config',
'/common/hyperscript.js',
'/common/common-feedback.js',
'/common/common-interface.js',
'/common/common-hash.js',
'/common/common-constants.js',
'/common/common-util.js',
@ -11,8 +9,8 @@ define([
'/customize/messages.js',
'/customize/application_config.js',
'/common/outer/local-store.js',
'/customize/pages.js'
], function ($, Config, h, Feedback, UI, Hash, Constants, Util, TextFit, Msg, AppConfig, LocalStore, Pages) {
'/customize/pages.js',
], function ($, Config, h, Hash, Constants, Util, TextFit, Msg, AppConfig, LocalStore, Pages) {
var urlArgs = Config.requireConf.urlArgs;
var isAvailableType = function (x) {
@ -46,8 +44,7 @@ define([
[ 'code', Msg.type.code],
[ 'form', Msg.type.form],
[ 'whiteboard', Msg.type.whiteboard],
[ 'slide', Msg.type.slide],
[ 'drive', Msg.type.drive]
[ 'slide', Msg.type.slide]
].filter(function (x) {
return isAvailableType(x[0]);
})
@ -55,6 +52,7 @@ define([
var s = 'div.bs-callout.cp-callout-' + x[0];
var cls = '';
var isEnabled = checkRegisteredType(x[0]);
var isEAEnabled = checkEarlyAccess(x[0]);
//if (i > 2) { s += '.cp-more.cp-hidden'; }
var icon = AppConfig.applicationsIcon[x[0]];
@ -62,6 +60,8 @@ define([
var href = '/'+ x[0] +'/';
var attr = isEnabled ? { href: href } : {
onclick: function () {
// if the app is not enabled then we send them to the login page
// which will redirect to the app in question ?
var loginURL = Hash.hashToHref('', 'login');
var url = Hash.getNewPadURL(loginURL, { href: href });
window.location.href = url;
@ -89,93 +89,119 @@ define([
TextFit($(a).find('.pad-button-text')[0], {minFontSize: 13, maxFontSize: 18});
});
});
UI.addTooltips();
var subscribeButton;
/* Display a subscribe button if they are enabled and the button's translation key exists */
if (Config.allowSubscriptions) {
subscribeButton = Pages.subscribeButton(function () {
Feedback.send('HOME_SUBSCRIBE_CRYPTPAD');
});
var isLocalURL = url => {
try {
return new URL(url, window.location.href).origin === window.location.origin;
} catch (err) {
console.error(err);
return /^\//.test(url);
}
};
var supportText = Pages.setHTML(h('span'), Msg.home_support);
Pages.documentationLink(supportText.querySelector('a'), "https://docs.cryptpad.fr/en/how_to_contribute.html");
var pageLink = function (ref, loc, text) {
if (!ref) { return; }
var attrs = {
href: ref,
};
if (!isLocalURL(ref)) {
attrs.target = '_blank';
attrs.rel = 'noopener noreferrer';
}
if (loc) {
attrs['data-localization'] = loc;
text = Msg[loc];
}
return h('a', attrs, text);
};
var opensource = Pages.setHTML(h('p'), Msg.home_opensource);
Pages.externalLink(opensource.querySelector('a'), "https://github.com/xwiki-labs/cryptpad");
var fastLink = k => pageLink(Pages.customURLs[k], k);
var blocks = [
h('div.row.cp-page-section', [
h('div.col-sm-6',
h('img.img-fluid.cp-img-invert', {
src:'/customize/images/shredder.png',
alt:'',
'aria-hidden': 'true'
})
),
h('div.col-sm-6', [
h('h2', Msg.home_privacy_title),
h('p', Msg.home_privacy_text)
])
]),
h('div.row.cp-page-section',
h('div.col-sm-12', [
h('h2', Msg.home_host_title),
h('p', Pages.hostDescription),
])
),
h('div.row.cp-page-section', [
h('div.col-sm-6', [
h('h2', Msg.home_opensource_title),
opensource,
h('img.small-logo.cp-img-invert', {
src: '/customize/images/logo_AGPLv3.svg',
alt: 'APGL3 License Logo'
})
]),
h('div.col-sm-6', [
h('h2', Msg.home_support_title),
supportText,
subscribeButton,
Pages.crowdfundingButton(function () {
Feedback.send('HOME_SUPPORT_CRYPTPAD');
}),
])
])
];
var imprintLink = fastLink('imprint');
var privacyLink = fastLink('privacy');
var termsLink = fastLink('terms');
var notice;
/* Admins can specify a notice to display in application_config.js via the `homeNotice` attribute.
If the text is the key for the translation system then then the most appropriate translated text
will be displayed. Otherwise, the direct text will be included as HTML.
*/
if (AppConfig.homeNotice) {
notice = h('div.alert.alert-info', Pages.setHTML(h('span'), [
Msg[AppConfig.homeNotice] || AppConfig.homeNotice
]));
if (Pages.Instance.notice) {
console.log(Pages.Instance.notice);
notice = h('div.alert.alert-info', Pages.setHTML(h('span'), Pages.Instance.notice));
}
// instance title
var instanceTitle = h('h1.cp-instance-title', Pages.Instance.name);
// instance location
var locationBlock;
if (Pages.Instance.location) {
locationBlock = h('div.cp-instance-location', [
h('i.fa.fa-map-pin', {'aria-hidden': 'true'}),
Msg._getKey('home_location', [ Pages.Instance.location ]),
]);
} else {
locationBlock = h('div', h('br'));
}
var subButton = function () {
if (Pages.areSubscriptionsAllowed() && !LocalStore.getPremium()) {
var sub = h('div.cp-sub-prompt', [
h('span', Msg.home_morestorage),
h('a', {href:"/accounts/"}, h('button', [
h('i.fa.fa-ticket'),
Msg.features_f_subscribe
]))
]);
return sub;
} else {
return h('div');
}
};
return [
h('div#cp-main', [
Pages.infopageTopbar(),
notice,
h('div.container.cp-container', [
h('div.row.cp-home-hero', [
h('div.cp-title.col-md-7', [
h('div.cp-title.col-lg-6', [
h('img', {
src: '/customize/CryptPad_logo.svg?' + urlArgs,
'aria-hidden': 'true',
alt: ''
}),
h('h1', 'CryptPad'),
UI.setHTML(h('span.tag-line'), Msg.main_catch_phrase)
instanceTitle,
Pages.setHTML(h('span.tag-line'), Pages.Instance.description),
locationBlock,
h('div.cp-instance-links', [
termsLink,
privacyLink,
imprintLink,
h('a', {href:"/contact.html"}, Msg.contact)
])
]),
h('div.col-md-5.cp-app-grid', [
h('div.cp-apps.col-lg-6', [
h('div.cp-app-grid', [
h('span.cp-app-new', [
h('i.fa.fa-plus'),
Msg.fm_newFile
]),
h('div.cp-app-grid-apps', [
icons,
])
]),
notice,
blocks
h('div.cp-app-drive', [
h('a.cp-drive-btn', {'href': '/drive/'}, [
h('i.fa.fa-hdd-o', {'aria-hidden': 'true'}),
Msg.team_cat_drive
]),
subButton
])
])
]),
]),
Pages.infopageFooter(),
]),

@ -14,6 +14,7 @@ define([
h('div.row', [
h('div.col-md-3'),
h('div#userForm.form-group.hidden.col-md-6', [
h('div.cp-login-instance', Msg._getKey('login_instance', [ Pages.Instance.name ])),
h('input.form-control#name', {
name: 'name',
type: 'text',
@ -33,11 +34,11 @@ define([
UI.createCheckbox('import-recent', Msg.register_importRecent),
]),
h('div.extra', [
h('button.login', Msg.login_login),
(Config.restrictRegistration?
undefined:
h('button#register.cp-secondary', Msg.login_register)
)
),
h('button.login', Msg.login_login)
])
]),
h('div.col-md-3')

@ -8,13 +8,12 @@ define([
], function (Config, $, h, UI, Msg, Pages) {
return function () {
document.title = Msg.register_header;
var urlArgs = Config.requireConf.urlArgs;
var tos = $(UI.createCheckbox('accept-terms')).find('.cp-checkmark-label').append(Msg.register_acceptTerms).parent()[0];
var termsLink = Pages.customURLs.terms;
$(tos).find('a').attr({
href: termsLink, // '/terms.html',
href: termsLink,
target: '_blank',
tabindex: '-1',
});
@ -25,10 +24,9 @@ define([
Pages.infopageTopbar(),
h('div.container.cp-container', [
h('div.row.cp-page-title', h('h1', Msg.register_header)),
//h('div.row.cp-register-det', content),
].concat(content)),
]),
Pages.infopageFooter(),
]),
];
};
@ -52,13 +50,14 @@ define([
Pages.setHTML(h('div.cp-register-notes'), Msg.register_notes)
]),
h('div.cp-reg-form.col-md-6', [
h('img.img-fluid', {
src: '/customize/images/swallow-the-key.png?' + urlArgs
}),
h('div#userForm.form-group.hidden', [
h('div.cp-register-instance', [
Msg._getKey('register_instance', [ Pages.Instance.name ]),
h('br'),
h('a', {
href: '/features.html'
}, Msg.register_whyRegister),
}, Msg.register_whyRegister)
]),
h('input.form-control#username', {
type: 'text',
autocomplete: 'off',

@ -1,24 +0,0 @@
define([
'/common/hyperscript.js',
'/customize/messages.js',
'/customize/pages.js'
], function (h, Msg, Pages) {
return function () {
document.title = Msg.footer_tos;
return h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container.cp-container', [
h('.row.cp-page-title', h('h1', Msg.tos_title)),
h('.row', [
h('p', Msg.tos_legal),
h('p', Msg.tos_availability),
h('p', Msg.tos_e2ee),
h('p', Msg.tos_logs),
h('p', Msg.tos_3rdparties),
])
]),
Pages.infopageFooter()
]);
};
});

@ -1,113 +0,0 @@
define([
'/api/config',
'/common/hyperscript.js',
'/customize/messages.js',
'/customize/pages.js',
'/common/common-feedback.js',
], function (Config, h, Msg, Pages, Feedback) {
var urlArgs = Config.requireConf.urlArgs;
var logoLink = function (alt, src, url, cls) {
var img = h('img' + (cls || ''), {
src: src + '?' + urlArgs,
alt: alt,
});
if (!url) { return img; }
return h('a', { href: url, }, img);
};
return function () {
var xwiki_info = Pages.setHTML(h('span'), Msg.whatis_xwiki_info);
Pages.externalLink(xwiki_info.querySelector('a'), "https://xwiki.com");
return h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container.cp-container', [
h('div.row.cp-page-title',[
h('div.col-12.text-center', h('h1', Msg.whatis_title)),
]),
h('div.row.cp-page-section', [
h('div.col-md-6', [
Pages.setHTML(h('h2'), Msg.whatis_collaboration),
Pages.setHTML(h('span'), Msg.whatis_collaboration_info),
]),
h('div.col-md-6', [
h('img.cp-img-invert', {
src: '/customize/images/collaboration.png?' + urlArgs,
alt: '',
'aria-hidden': 'true'
}),
]),
]),
h('div.row.cp-page-section', [
h('div.col-md-6.order-md-2', [
Pages.setHTML(h('h2'), Msg.whatis_apps),
Pages.setHTML(h('span'), Msg.whatis_apps_info),
]),
h('div.col-md-6.order-md-1', [
h('img', {
src: '/customize/images/apps-preview.png?' + urlArgs,
alt: '',
'aria-hidden': 'true'
}),
]),
]),
h('div.row.cp-page-section', [
h('div.col-md-6', [
Pages.setHTML(h('h2'), Msg.whatis_drive),
Pages.setHTML(h('span'), Msg.whatis_drive_info),
]),
h('div.col-md-6', [
h('img.cp-shadow', {
src: '/customize/images/drive-grid.png?' + urlArgs,
alt: '',
'aria-hidden': 'true'
}),
]),
]),
h('div.row.cp-page-section', [
h('div.col-md-6.order-md-2', [
Pages.setHTML(h('h2'), Msg.whatis_model),
Pages.setHTML(h('span'), Msg.whatis_model_info),
Config.allowSubscriptions ?
Pages.subscribeButton(function () {
Feedback.send('WHATIS_SUBSCRIBE_CRYPTPAD');
}) : undefined,
Pages.crowdfundingButton(function () {
Feedback.send('WHATIS_SUPPORT_CRYPTPAD');
}),
]),
h('div.col-md-6.order-md-1.small-logos', [
logoLink('NGI Award 2019', '/customize/images/logo_ngi.png',
'https://www.ngi.eu/', '.cp-img-invert'),
logoLink('NLnet Foundation logo', '/customize/images/logo_nlnet.svg',
'https://nlnet.nl', '.cp-img-invert'),
logoLink('BPI France logo', '/customize/images/logo_bpifrance.svg',
'https://bpifrance.com'),
logoLink('Mozilla Open Source Support logo', '/customize/images/logo_moss.jpg',
'https://www.mozilla.org/en-US/moss/'),
logoLink('NGI Trust logo', '/customize/images/logo_ngi_trust.png',
'https://www.ngi.eu/ngi-projects/ngi-trust/'),
logoLink('NGI DAPSI LOGO', '/customize/images/logo_ngi_dapsi.png',
'https://dapsi.ngi.eu/'),
]),
]),
h('div.row.cp-page-section', [
h('div.col-md-6', [
Pages.setHTML(h('h2'), Msg.whatis_xwiki),
xwiki_info,
]),
h('div.col-md-6.small-logos', [
h('img', {
src: '/customize/images/logo_XWiki.svg?' + urlArgs,
alt: 'Logo XWiki'
}),
]),
]),
]),
Pages.infopageFooter(),
]);
};
});

@ -122,6 +122,7 @@
.dialog {
& > div {
background-color: @cp_alertify-bg;
border-radius: @variables_radius_L;
&.half {
width: 50%;
max-width: 50%;
@ -205,6 +206,8 @@
box-sizing: border-box;
padding: 0 15px;
cursor: pointer;
border-top-left-radius: @variables_radius;
border-top-right-radius: @variables_radius;
&:not(.disabled):hover {
background-color: @cp_alertify-hover;
}

@ -1,5 +1,6 @@
@import (reference) "./tools.less";
@import (reference) "./colortheme-all.less";
@import (reference) "./variables.less";
.avatar_vars(
@width: 30px
) {
@ -24,6 +25,7 @@
font-size: 16px;
display: flex;
align-items: center;
border-radius: @variables_radius;
.cp-avatar-default, media-tag {
display: inline-flex;
@ -32,6 +34,8 @@
height: @avatar-width;
height: var(--avatar-width);
border-radius: @variables_radius;
justify-content: center;
align-items: center;

@ -1,5 +1,6 @@
@import (reference) "./colortheme-all.less";
@import (reference) "./tools.less";
@import (reference) "./variables.less";
.checkmark_vars(
@size: 20px
@ -39,6 +40,9 @@
align-items: center;
position: relative;
.tools_unselectable();
.cp-checkmark-mark {
border-radius: @variables_radius;
}
& > a {
margin-left: 0.25em;

@ -48,6 +48,9 @@
@cryptpad_color_black: #000;
@cryptpad_text_col: @cryptpad_color_grey_200;
@cryptpad_text_col_inv: @cryptpad_color_grey_900;
@cryptpad_ui_shadow: 0px 0px 5px 1px #00000030;
@cryptpad_color_blue: #326599; // former logo-1
@cryptpad_color_light_blue: #00b7d8;
@ -168,11 +171,13 @@
@cp_buttons-cancel-border: @cryptpad_color_grey_400;
// Sidebar layout
@cp_sidebar-left-bg: @cryptpad_color_grey_850;
@cp_sidebar-left-bg: @cryptpad_color_grey_900;
@cp_sidebar-left-fg: @cryptpad_text_col;
@cp_sidebar-left-item-bg: @cryptpad_color_grey_800;
@cp_sidebar-right-bg: @cryptpad_color_grey_900;
@cp_sidebar-right-fg: @cryptpad_text_col;
@cp_sidebar-left-active: @cp_sidebar-right-bg;
@cp_sidebar-left-active: @cryptpad_color_grey_400;
@cp_sidebar-left-active-fg: @cryptpad_color_grey_900;
@cp_sidebar-hint: fade(@cryptpad_text_col, 80%);
// Drive
@ -190,9 +195,9 @@
@cp_drive-droppable-bg: @cryptpad_color_grey_700;
@cp_drive-droppable-fg: @cryptpad_text_col;
@cp_drive-infobox-bg: @cryptpad_color_brand_fadest;
@cp_drive-infobox-fg: @cryptpad_text_col;
@cp_drive-warnbox-bg: @cryptpad_color_warn_red;
@cp_drive-warnbox-fg: @cryptpad_text_col;
@cp_drive-infobox-fg: @cryptpad_color_brand_300;
@cp_drive-warnbox-bg: @cryptpad_color_red_fader;
@cp_drive-warnbox-fg: @cryptpad_color_light_red;
@cp_drive-tree-branch: @cryptpad_text_col;
// Contextmenu
@ -232,6 +237,7 @@
// Pad Creation Screen
@cp_creation-bg: @cryptpad_color_grey_800;
@cp_creation-fg: @cryptpad_text_col;
@cp_creation-template: @cryptpad_color_grey_700;
@cp_creation-button-bg: @cryptpad_color_brand;
@cp_creation-button-fg: @cryptpad_color_white;
@cp_creation-error-bg: @cryptpad_color_blue;
@ -259,10 +265,11 @@
@cp_static-fg: @cryptpad_text_col;
@cp_static-link: @cryptpad_color_brand_300;
@cp_static-title: @cryptpad_color_brand;
@cp_static-footer: @cryptpad_color_grey_950;
@cp_static-footer: fade(@cryptpad_color_brand, 20%);
@cp_static-footer-border: @cryptpad_color_grey_600;
@cp_static-topbar-fg: @cryptpad_color_brand_300;
@cp_static-card-bg: @cryptpad_color_grey_800;
@cp_static-danger: @cryptpad_color_red_fade;
@cp_static-img-invert-filter: hue-rotate(200grad) invert();
// Limit
@ -293,9 +300,10 @@
@cp_support-header-bg: @cryptpad_color_grey_700;
// Toolbar
@cp_toolbar-bg: @cryptpad_color_grey_850;
@cp_toolbar-bg: @cryptpad_color_grey_900;
@cp_toolbar-fg: @cryptpad_text_col;
@cp_toolbar-bottom-fg: @cryptpad_text_col;
@cp_toolbar-bottom-bg: @cryptpad_text_col;
@cp_toolbar-bottom-fg: @cryptpad_color_grey_900;
@cp_toolbar-logo-bg: @cryptpad_color_grey_200;
@cp_toolbar-fade1: fade(@cryptpad_text_col, 10%);
@ -305,7 +313,7 @@
@cp_history-line-bg: @cryptpad_color_grey_900;
@cp_history-bg1: @cryptpad_color_grey_600;
@cp_history-bg2: @cryptpad_color_grey_800;
@cp_history-fg: @cp_toolbar-bottom-fg;
@cp_history-fg: @cp_toolbar-fg;
// Tokenfield
@cp_token-bg: @cryptpad_color_grey_700;
@ -371,8 +379,10 @@
@cp_kanban-tags-bg: @cryptpad_color_grey_700;
@cp_kanban-add-hover: fade(@cryptpad_color_black, 10%);
@cp_kanban-trash-bg: @cryptpad_color_warn_red;
@cp_kanban-color0: @cryptpad_color_grey_600;
@cp_kanban-colors: @cp_palette-dark;
@cp_kanban-color0: @cryptpad_color_grey_400;
@cp_kanban-colors: @cp_palette;
@cp_kanban-card-colors: @cp_palette-dark;
// Notifications
@cp_notif-hover: fade(@cryptpad_color_black, 10%);
@ -417,7 +427,7 @@
// Teams
@cp_teams-card-bg: @cryptpad_color_grey_800;
@cp_teams-leftside-bg: darken(@cryptpad_color_grey_800, 10%);
@cp_teams-leftside-bg: @cp_sidebar-left-bg;
@cp_teams-invite-bg: fade(@cryptpad_color_brand, 50%);
@cp_teams-invite-fg: @cryptpad_text_col;
@cp_teams-roster-odd: fade(@cryptpad_text_col, 15%);

@ -48,6 +48,9 @@
@cryptpad_color_black: #000;
@cryptpad_text_col:@cryptpad_color_grey_800;
@cryptpad_text_col_inv: @cryptpad_color_grey_50;
@cryptpad_ui_shadow: 0px 0px 5px 1px #00000030;
@cryptpad_color_blue: #326599; // former logo-1
@cryptpad_color_light_blue: #00b7d8;
@ -167,11 +170,13 @@
@cp_buttons-cancel-border: #949494;
// Sidebar layout
@cp_sidebar-left-bg: @cryptpad_color_grey_200;
@cp_sidebar-left-bg: @cryptpad_color_white;
@cp_sidebar-left-fg: @cryptpad_text_col;
@cp_sidebar-left-item-bg: @cryptpad_color_grey_200;
@cp_sidebar-right-bg: @cryptpad_color_white;
@cp_sidebar-right-fg: @cryptpad_text_col;
@cp_sidebar-left-active: @cp_sidebar-right-bg;
@cp_sidebar-left-active: @cryptpad_color_grey_700;
@cp_sidebar-left-active-fg: @cryptpad_color_grey_200;
@cp_sidebar-hint: @cryptpad_color_grey_600;
// Drive
@ -190,8 +195,8 @@
@cp_drive-droppable-fg: @cryptpad_text_col;
@cp_drive-infobox-bg: @cryptpad_color_brand_fadest;
@cp_drive-infobox-fg: @cryptpad_text_col;
@cp_drive-warnbox-bg: @cryptpad_color_warn_red;
@cp_drive-warnbox-fg: @cryptpad_text_col;
@cp_drive-warnbox-bg: @cryptpad_color_light_red_fade;
@cp_drive-warnbox-fg: darken(@cp_alerts-danger-fg, 55%);
@cp_drive-tree-branch: @cryptpad_text_col;
// Contextmenu
@ -231,6 +236,7 @@
// Pad Creation Screen
@cp_creation-bg: @cryptpad_color_white;
@cp_creation-fg: @cryptpad_text_col;
@cp_creation-template: @cryptpad_color_grey_100;
@cp_creation-button-bg: @cryptpad_color_brand;
@cp_creation-button-fg: @cryptpad_color_white;
@cp_creation-error-bg: @cryptpad_color_blue;
@ -258,15 +264,16 @@
@cp_static-fg: @cryptpad_text_col;
@cp_static-link: @cryptpad_color_brand;
@cp_static-title: @cryptpad_color_brand;
@cp_static-footer: @cryptpad_color_grey_300;
@cp_static-footer: fade(@cryptpad_color_brand_300, 30%);
@cp_static-footer-border: @cryptpad_color_white;
@cp_static-topbar-fg: @cryptpad_color_brand;
@cp_static-card-bg: @cryptpad_color_white;
@cp_static-danger: fade(@cryptpad_color_red, 30%);
@cp_static-img-invert-filter: none;
// Limit
@cp_limit-fg: @cryptpad_text_col;
@cp-limit-bar-bg: @cryptpad_color_white;
@cp-limit-bar-bg: @cryptpad_color_grey_200;
@cp-limit-bar-normal: @cryptpad_color_green;
@cp-limit-bar-warning: @cryptpad_color_orange;
@cp-limit-bar-above: @cryptpad_color_red;
@ -292,8 +299,9 @@
@cp_support-header-bg: @cryptpad_color_grey_300;
// Toolbar
@cp_toolbar-bg: @cryptpad_color_grey_200;
@cp_toolbar-bg: @cryptpad_color_white;
@cp_toolbar-fg: @cryptpad_text_col;
@cp_toolbar-bottom-bg: @cryptpad_color_grey_200;
@cp_toolbar-bottom-fg: @cryptpad_text_col;
@cp_toolbar-logo-bg: @cryptpad_color_white;
@ -304,7 +312,7 @@
@cp_history-line-bg: @cryptpad_color_white;
@cp_history-bg1: #DDD;
@cp_history-bg2: #BBB;
@cp_history-fg: @cp_toolbar-bottom-fg;
@cp_history-fg: @cp_toolbar-fg;
// Tokenfield
@cp_token-bg: @cryptpad_color_grey_400;
@ -318,10 +326,10 @@
@cp_usergrid-selected-fg: @cryptpad_color_white;
// Other
@cp_shadow-color: fade(@cryptpad_color_black, 30%);
@cp_shadow-color: fade(@cryptpad_color_black, 20%);
// Apps
@cp_app-bg: @cryptpad_color_grey_100;
@cp_app-bg: @cryptpad_color_white;
@cp_app-fg: @cryptpad_text_col;
// Accounts
@ -372,6 +380,7 @@
@cp_kanban-trash-bg: @cryptpad_color_warn_red;
@cp_kanban-color0: @cryptpad_color_grey_400;
@cp_kanban-colors: @cp_palette;
@cp_kanban-card-colors: @cp_palette;
// Notifications
@cp_notif-hover: fade(@cryptpad_color_black, 10%);
@ -416,7 +425,7 @@
// Teams
@cp_teams-card-bg: @cryptpad_color_grey_300;
@cp_teams-leftside-bg: darken(@cryptpad_color_grey_200, 5%);
@cp_teams-leftside-bg: @cp_sidebar-left-bg;
@cp_teams-invite-bg: fade(@cryptpad_color_brand, 50%);
@cp_teams-invite-fg: @cryptpad_text_col;
@cp_teams-roster-odd: fade(@cryptpad_text_col, 15%);

@ -98,6 +98,8 @@
background-color: @cp_comments-bg;
position: relative;
padding: 5px;
border-top-left-radius: @variables_radius;
border-top-right-radius: @variables_radius;
box-sizing: content-box;
.avatar_main(40px);
.cp-comment-metadata {
@ -114,8 +116,8 @@
cursor: pointer;
outline: none;
position: absolute;
right: 0;
top: 0;
right: 5px;
top: 5px;
width: 20px;
height: 20px;
text-align: center;
@ -128,6 +130,8 @@
.cp-comment-content {
background-color: @cp_comments-bg;
padding: 0px 5px 5px 5px;
border-bottom-left-radius: @variables_radius;
border-bottom-right-radius: @variables_radius;
white-space: pre-wrap;
word-break: break-word;
}
@ -150,6 +154,7 @@
}
.cp-comment-active {
background-color: rgba(0,0,0,0.2);
border-radius: @variables_radius;
.cp-comment-actions {
display: block;
}

@ -1,4 +1,5 @@
@import (reference) "./colortheme-all.less";
@import (reference) "./variables.less";
.contextmenu_main() {
--LessLoader_require: LessLoader_currentFile();
@ -11,11 +12,14 @@
& > ul {
border: 1px solid @cp_context-border;
background-color: @cp_context-bg;
border-radius: 0px;
border-radius: @variables_radius;
.dropdown-divider {
border-top: 1px solid @cp_context-border;
}
}
.dropdown-menu {
padding: 6px 0px;
}
li {
padding: 0;
font-size: @colortheme_app-font-size;
@ -38,7 +42,7 @@
top: -0.7rem;
left: 100%;
background-color: @cp_context-bg;
border-radius: 0px;
border-radius: @variables_radius;
border: 1px solid @cp_context-border;
}
}
@ -46,6 +50,7 @@
cursor: pointer;
color: @cp_context-fg;
padding-left: 10px;
border-radius: @variables_radius;
&:hover {
background-color: @cp_context-bg-hover;
color: @cp_context-fg;

@ -1,4 +1,5 @@
@import (reference) "./colortheme-all.less";
@import (reference) "./variables.less";
.corner_main() {
--LessLoader_require: LessLoader_currentFile();
@ -40,6 +41,7 @@
transform-origin: bottom right;
animation: appear 0.8s ease-in-out;
border: 1px solid @corner-fg;
border-radius: @variables_radius;
box-shadow: 0 0 10px 0 @cp_shadow-color;
&.cp-corner-alt {
@ -116,6 +118,7 @@
}
text-transform: uppercase;
border: 1px solid @corner-fg;
border-radius: @variables_radius;
.fa, .cptools {
margin-right: 0.3em;
}

@ -3,6 +3,7 @@
@import (reference) "./tools.less";
@import (reference) './icon-colors.less';
@import (reference) "./avatar.less";
@import (reference) "./variables.less";
.creation_vars(
@bg-color: @colortheme_apps[default]
@ -63,6 +64,7 @@
width: 700px;
max-width: 90vw;
height: 500px;
border-radius: @variables_radius_L;
max-height: ~"calc(100vh - 20px)";
margin: 0px;
flex-shrink: 0;
@ -131,6 +133,7 @@
color: @cp_creation-button-fg;
margin: 3px 10px;
border: none;
border-radius: @variables_radius;
cursor: pointer;
outline: none;
text-transform: uppercase;
@ -256,6 +259,7 @@
}
select {
margin-right: 5px;
border-radius: @variables_radius;
}
}
&.active {
@ -325,11 +329,12 @@
max-height: 159px;
align-items: center;
.cp-creation-template-element {
box-shadow: 2px 2px 7px @cp_shadow-color;
box-shadow: @cryptpad_ui_shadow;
width: 300px;
max-width: calc(100% - 10px);
padding: 2px;
padding: 5px;
margin: 5px;
border-radius: @variables_radius;
display: inline-flex;
box-sizing: border-box;
@ -337,7 +342,7 @@
text-align: left;
line-height: 1em;
cursor: pointer;
background-color: @cp_creation-template;
color: @creation-color;
color: var(--creation-color);
border: 1px solid transparent;

@ -121,6 +121,9 @@
.cp-app-drive-tree-category {
margin-top: 0.5em;
}
.cp-splitter {
display: none;
}
}
}
}
@ -164,6 +167,10 @@
.cptools {
color: @cp_drive-selected-fg;
}
&.cp-app-drive-element-active {
background: @cp_drive-selected-bg !important;
color: @cryptpad_text_col !important;
}
}
.cp-app-drive-element-selected-tmp {
@ -265,12 +272,11 @@
box-sizing: border-box;
background: @cp_sidebar-left-bg;
overflow: auto;
resize: horizontal;
width: auto;
white-space: nowrap;
max-width: 500px;
min-width: 200px;
padding: 0px;
padding: 10px 0px 0px 0px;
color: @cp_sidebar-left-fg;
display: flex;
flex-flow: column;
@ -279,6 +285,7 @@
.cp-app-drive-tree-categories-container {
flex: 1;
overflow: auto;
padding: 0px 5px;
}
img.cp-app-drive-icon {
margin-bottom: 3px;
@ -288,6 +295,8 @@
margin-top: 15px;
//padding: 0 0 0 20px;
padding: 0;
background-color: @cp_sidebar-left-item-bg;
border-radius: @variables_radius;
cursor: auto;
&li, li {
padding: 0;
@ -295,7 +304,6 @@
display: none;
}
input {
//width: ~"calc(100% - 30px)";
flex: 1;
min-width: 0;
padding: 0 10px;
@ -305,11 +313,8 @@
& > span.cp-app-drive-element-row {
overflow: hidden;
text-overflow: ellipsis;
//min-width: ~"calc(100% + 5px)";
.leftside-menu-category_main();
width: ~"calc(100% + 5px)";
margin: 0;
//margin-bottom: -6px;
display: flex;
align-items: center;
cursor: pointer;
@ -318,8 +323,9 @@
.fa, .cptools {
display: inline-block;
min-width: 0;
width: 25px;
width: 20px;
margin-right: 0px;
z-index: 99;
}
.cp-app-drive-element {
flex: 1;
@ -335,7 +341,10 @@
}
.cp-app-drive-tree-category {
margin: 0;
margin-top: 15px;
margin-top: 10px;
background-color: @cp_sidebar-left-item-bg;
border-radius: @variables_radius;
box-shadow: @cryptpad_ui_shadow;
.cp-app-drive-tree-root {
.fa-trash-o {
padding-left: 2px;
@ -361,11 +370,11 @@
margin-left: -10px;
font-size: 14px;
position: absolute;
left: -20px;
top: 10px;
left: -17px;
top: 11px;
width: 11px !important;
height: 11px !important;
background-color: @cp_sidebar-left-bg;
background-color: @cp_sidebar-left-item-bg;
padding: 0;
margin: 0;
z-index: 10;
@ -376,17 +385,35 @@
}
}
.cp-app-drive-tree-docs {
box-shadow: @cryptpad_ui_shadow;
.cp-app-drive-element-row {
&.cp-leftside-active {
.cp-app-drive-icon-expcol {
color: @cryptpad_text_col; // +/- expand icon for folders
}
}
}
.cp-app-drive-tree-root > .cp-app-drive-element-row {
margin-left: 0px;
&.cp-app-drive-element-active {
.cp-app-drive-icon-expcol {
color: @cp_sidebar-left-active-fg; // +/- expand icon for drive
}
}
}
.cp-app-drive-tree-root > .cp-app-drive-element-row > .cp-app-drive-icon-expcol {
position: relative;
top: 0;
left: -10px;
background-color: transparent;
}
.cp-app-drive-tree-root > .cp-app-drive-element-row > .cp-app-drive-icon-folder {
margin-left: -5px;
}
.cp-app-drive-tree-root {
&> .cp-app-drive-element-row {
padding-left: 20px;
padding-left: 15px;
}
&> ul {
padding-left: 30px;
@ -403,8 +430,8 @@
position: relative;
&:before {
position: absolute;
left: -15px;
top: -11px;
left: -12px;
top: -10px;
content: '';
display: block;
border-left: 1px solid @cp_drive-tree-branch;
@ -414,7 +441,7 @@
}
&:after {
position: absolute;
left: -15px;
left: -12px;
bottom: -7px;
content: '';
display: block;
@ -441,13 +468,40 @@
#cp-app-drive-content-container {
display: flex;
flex-flow: column;
flex: 1 1 100%;
flex: 1;
min-width: 0;
position: relative;
.cp-splitter {
position: absolute;
height: 100%;
width: 8px;
top: 0;
left: 0;
cursor: col-resize;
display: flex;
align-items: center;
justify-content: flex-end;
&:hover {
border-left: 1px solid @cryptpad_text_col;
}
i {
color: @cryptpad_text_col;
font-size: 1.6rem;
}
}
&.cp-app-drive-readonly { // applied to offline drive (not read-only shared folders)
#cp-app-drive-content-folder {
opacity: 0.5;
}
// background: contrast(@cp_sidebar-right-bg, darken(@cp_sidebar-right-bg, 10%), lighten(@cp_sidebar-right-bg, 10%));
}
}
#cp-app-drive-content {
box-sizing: border-box;
background: @cp_sidebar-right-bg;
color: @cp_sidebar-right-fg;
padding-top: 10px;
overflow-y: auto;
flex: 1;
display: flex;
@ -459,9 +513,6 @@
position: absolute;
z-index: 50;
}
&.cp-app-drive-readonly {
background: contrast(@cp_sidebar-right-bg, darken(@cp_sidebar-right-bg, 10%), lighten(@cp_sidebar-right-bg, 10%));
}
h1 {
padding-left: 10px;
margin-top: 10px;
@ -473,6 +524,7 @@
margin: 1em;
background: @cp_drive-infobox-bg;
color: @cp_drive-infobox-fg;
border-radius: @variables_radius;
cursor: default;
a {
color: @cryptpad_color_link;
@ -570,6 +622,7 @@
}
.drive_fileIcon;
li {
border-radius: @variables_radius;
&.cp-app-drive-element {
position: relative;
}
@ -639,6 +692,7 @@
}
li {
display: flex;
border-radius: @variables_radius;
input {
border: 1px solid transparent;
margin: 0;
@ -727,6 +781,7 @@
}
&> span {
padding: 14px 5px;
border-radius: @variables_radius;
&.cp-app-drive-sort-clickable {
cursor: pointer;
&:hover {
@ -858,6 +913,7 @@
flex-flow: column;
li, li .fa, li .cptools {
cursor: pointer;
border-radius: @variables_radius;
}
&> p {
display: flex;
@ -912,6 +968,18 @@
.cp-toolbar-bottom {
.cp-toolbar-bottom-left {
@drive-light: lighten(@cryptpad_color_brand, 30%);
.cp-app-drive-toolbar-new {
border-radius: @variables_radius;
color: @cryptpad_color_grey_900;
border-color: @drive-light;
background-color: @drive-light;
&:hover {
background-color: fade(@drive-light, 80%);
}
}
}
.cp-toolbar-bottom-right {
.fa-history { order: 50; }
// .fa-list, .fa-th-large,

@ -60,6 +60,8 @@
position: absolute;
background-color: @cp_dropdown-bg;
min-width: 250px;
padding: 5px;
border-radius: @variables_radius;
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.2);
z-index: 1000; //Z dropdown content
max-height: 300px;
@ -77,7 +79,8 @@
& > a, & > span {
color: @cp_dropdown-fg;
padding: 5px 16px;
border-radius: @variables_radius;
padding: 5px;
text-decoration: none;
display: flex;
cursor: pointer;
@ -160,7 +163,6 @@
height: 1px;
background: @cp_dropdown-bg-active;
border: 0 !important;
border-top: 1px solid rgba(0,0,0,.1) !important;
& + hr {
display: none;
}

@ -1,6 +1,7 @@
@import (reference) "./browser.less";
@import (reference) './colortheme-all.less';
@import (reference) './modal.less';
@import (reference) './variables.less';
.fileupload_main () {
--LessLoader_require: LessLoader_currentFile();
@ -13,6 +14,7 @@
position: absolute;
right: 10vw;
bottom: 10vh;
border-radius: @variables_radius;
box-sizing: border-box;
z-index: 100001; //Z file upload table container: just above the file picker
display: none;
@ -88,6 +90,7 @@
height: 100%;
background-color: @cp_upload-progress;
z-index: -1; //Z file upload progress container
border-radius: @variables_radius;
}
.cp-fileupload-table-cancel {
text-align: center;

@ -14,6 +14,7 @@
color: @cp_forms-fg;
background-color: @cp_forms-bg;
border: 1px solid @cp_forms-border;
border-radius: @variables_radius;
font-size: 100%;
padding: @alertify_padding-base;
&:not(.tui-full-calendar-content) {
@ -39,6 +40,7 @@
input {
margin: 0 !important;
flex: 1;
border-radius: @variables_radius 0 0 @variables_radius !important;
min-width: 0;
}
span {
@ -47,6 +49,7 @@
height: 100%;
margin-left: -1px;
text-transform: unset !important;
border-radius: 0 @variables_radius @variables_radius 0;
}
}
}
@ -79,11 +82,15 @@
}
button {
margin: 0 !important;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
.cp-button-timer {
height: 3px;
& > div {
height: 100%;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
background-color: @cp_buttons-primary;
&.danger, &.btn-danger, &.danger-alt, &.btn-danger-alt {
background-color: @cp_buttons-red;
@ -109,7 +116,7 @@
font-size: 14px;
text-decoration: none;
cursor: pointer;
border-radius: 0;
border-radius: @variables_radius;
transition: none;
i, .fa, .cptools {
@ -230,7 +237,7 @@
margin: 0px 0px @alertify_padding-base 0px;
font-size: 12px;
padding: 5px;
border-radius: 0px;
border-radius: @variables_radius;
i {
margin-right: 10px;
}
@ -288,9 +295,11 @@
font-weight: bold;
text-transform: uppercase;
cursor: default;
border-radius: @variables_radius;
&.cp-banner-danger {
background-color: @cp_drive-warnbox-bg;
color: @cp_drive-warnbox-fg;
border: 1px solid @cp_drive-warnbox-fg;
}
&.cp-banner-info {
background-color: @cp_drive-infobox-bg;
@ -303,7 +312,7 @@
.flatpickr-calendar {
background: @cp_flatpickr-bg;
color: @cryptpad_text_col;
border-radius: 0;
border-radius: @variables_radius;
box-shadow: @variables_shadow;
-webkit-box-shadow: @variables_shadow;
&.arrowTop::before, &.arrowTop::after {

@ -11,6 +11,7 @@
padding-top: 5px;
padding-bottom: 5px;
border: 1px solid transparent;
border-radius: @variables_radius;
.cp-icons-name {
width: 100%;

@ -1,6 +1,9 @@
@import (reference) "./colortheme-all.less";
@import (reference) "./font.less";
@infopages-radius: 5px;
@infopages-radius-L: 10px;
.infopages_link () {
text-decoration: none;
color: @cryptpad_color_link;
@ -11,7 +14,7 @@
}
}
.cp-shadow() {
box-shadow: 0px 0px 25px 0px @cp_shadow-color;
box-shadow: 0px 0px 20px 0px @cp_shadow-color;
}
.infopages_main () {
@ -52,7 +55,7 @@ body.html {
padding-top: @infopages_padding;
padding-bottom: @infopages_padding;
min-height: 75vh;
max-width: 950px;
max-width: 1200px;
h1 {
font-size: 3em;
margin-bottom: 0.5em;
@ -109,7 +112,7 @@ body.html {
border: none;
padding: 10px 20px;
margin-right: 10px;
border-radius: 0px;
border-radius: @infopages-radius;
cursor: pointer;
&:hover, &:focus {
background-color: contrast(@cp_buttons-primary-text, darken(@cp_buttons-primary, 10%), lighten(@cp_buttons-primary, 10%));
@ -122,9 +125,9 @@ body.html {
}
.form-group {
& > * {
margin-top: 0.5em;
}
// & > * {
// margin-bottom: 0.5em;
// }
display: flex;
flex-direction: column;
align-items: center;
@ -142,56 +145,103 @@ body.html {
}
}
footer {
background-color: @cp_static-footer;
padding-top: 20px;
align-self: normal; // override align-items:center from parent in index.html
.container {
margin-bottom: 20px;
box-shadow: inset 0px 7px 15px -7px rgba(0,0,0,0.3);
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: row;
flex-wrap: wrap;
.cp-footer-left, .cp-footer-center, .cp-footer-right {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
a {
color: @cp_static-link;
&:visited {
color: @cp_static-link;
}
margin-right: 10px;
}
}
.cp-logo-foot {
display: flex;
flex-flow: column;
width: 100%;
flex-flow: row;
align-items: center;
padding: 10px;
img {
max-width: 60px;
display: block;
max-height: 40px;
margin-right: 10px;
}
.logo-font {
display: block;
font-family: "IBM Plex Mono";
font-size: 1.5rem;
color: @cp_static-title;
margin-bottom: 10px;
color: @cryptpad_text_col;
height: 40px;
}
}
.cp-version-footer {
background-color: @cp_static-footer;
display: flex;
flex-flow: column;
align-items: center;
padding: 0.5em;
border-top: 1px solid @cp_static-footer-border;
.cp-logo-btns {
padding: 10px;
a {
background-color: @cryptpad_color_link;
color: @cryptpad_text_col_inv;
border-radius: @infopages-radius;
padding: 0.5em 0.7em;
white-space: nowrap;
display: inline-block;
i {
margin-right: 5px;
}
&:hover {
background-color: @cp_static-card-bg;
color: @cryptpad_text_col;
text-decoration: none;
}
}
}
.cp-footer-language {
padding: 10px;
margin-right: 10px;
i {
font-size: 1.3em;
margin-right: 5px;
}
select {
min-width: 0;
margin-bottom: 10px;
background-color: @cp_static-card-bg;
color: @cryptpad_text_col;
border: 0px;
border-radius: @infopages-radius;
padding: 0.5em 0.7em;
}
}
.cp-footer-version {
padding: 10px;
font-family: 'IBM Plex Mono';
}
// .cp-version-footer {
// background-color: @cp_static-footer;
// display: flex;
// flex-flow: column;
// align-items: center;
// padding: 0.5em;
// border-top: 1px solid @cp_static-footer-border;
// select {
// min-width: 0;
// margin-bottom: 10px;
// }
// }
}
// navigation top bar
.navbar {
width: 100%;
color: @cp_static-topbar-fg;
justify-content: flex-end;
.navbar-brand {
display: block;
height: 50px;
@ -208,20 +258,39 @@ body.html {
margin-right: 0;
}
a {
border: 2px solid transparent;
//border: 2px solid transparent;
white-space: nowrap;
color: @cp_static-title;
background-color: @cp_static-card-bg;
border-radius: @infopages-radius;
}
.nav-link {
padding: 0.5em 0.7em;
margin: 5px;
color: @cp_static-link;
display: inline-block;
img {
max-height: 30px;
margin-right: 10px;
}
&.cp-back-home {
margin-right: auto;
}
&:hover {
color: @cryptpad_text_col;
}
i {
margin-right: 5px;
}
}
.cp-register-btn {
border: 2px solid @cp_static-topbar-fg;
background-color: @cp_static-topbar-fg;
color: @cp_static-bg;
display: inline-block;
&:hover {
background-color: @cp_static-card-bg;
color: @cryptpad_text_col;
}
}
button:focus {
outline: none;
@ -231,26 +300,5 @@ body.html {
color: @cp_static-topbar-fg;
}
}
@media (max-width: 1000px) {
#menuCollapse {
text-align: right;
/* @media (min-width: 576px) {
top: 100%;
background: rgba(255,255,255,0.8);
position: absolute;
right: 0px;
padding: 0 20px;
z-index: 1;
}
*/
}
.navbar-nav a {
text-align: right !important;
}
.cp-register-btn {
margin-right: 13px;
text-align: center;
}
}
}

@ -4,20 +4,23 @@
.leftside-menu-category_main() {
.unselectable_make();
padding: 5px 15px;
margin: 15px 0;
padding: 5px;
margin: 10px 0;
cursor: pointer;
height: @variables_bar-height;
border-radius: @variables_radius;
background-color: @cp_sidebar-left-item-bg;
.fa, .cptools {
display: inline-flex;
justify-content: center;
margin-right: 5px;
min-width: 25px;
min-width: 20px;
}
&:hover {
background: fade(@cryptpad_text_col, 10%);
background: @cryptpad_text_col_inv;
}
&.cp-leftside-active {
background: @cp_sidebar-left-active;
color: @cp_sidebar-left-active-fg;
}
}

@ -1,4 +1,5 @@
@import (reference) "./colortheme-all.less";
@import (reference) "./variables.less";
.limit-bar_main () {
--LessLoader_require: LessLoader_currentFile();
@ -23,6 +24,7 @@
width: ~"calc(100% - 10px)";
height: 10px;
overflow: hidden;
border-radius: @variables_radius;
.cp-limit-usage {
height: 10px;
display: inline-block;
@ -65,7 +67,7 @@
padding-bottom: 0;
justify-content: center;
flex: 1;
border-radius: 0px;
border-radius: @variables_radius;
}
}
}

@ -96,6 +96,7 @@
background: @cp_loading-msg-bg;
padding: 20px;
width: 100%;
border-radius: @variables_radius;
color: @cp_loading-fg;
text-align: left;
display: none;
@ -180,6 +181,7 @@
height: 24px;
background: @cp_loading-progress-bg;
border: 1px solid @cp_loading-progress-bar-bg;
border-radius: @variables_radius;
}
.cp-loading-progress-bar-value {
height: 100%;

@ -39,6 +39,7 @@
background-color: @cp_alertify-bg;
color: @cp_alertify-fg;
box-shadow: @variables_shadow;
border-radius: @variables_radius;
padding: @variables_padding;
padding-top: @variables_padding * 2;

@ -41,6 +41,7 @@
.cp-app-prop-size-container {
height: 20px;
background-color: @cryptpad_color_brand;
border-radius: @variables_radius;
margin: 10px 0;
padding: 0;
div {
@ -48,6 +49,8 @@
margin: 0;
padding: 0;
background-color: @cryptpad_color_grey_500;
border-top-left-radius: @variables_radius;
border-bottom-left-radius: @variables_radius;
}
}
.cp-app-prop-size-legend {
@ -65,6 +68,7 @@
height: 20px;
width: 20px;
margin-right: 10px;
border-radius: @variables_radius;
}
.cp-app-prop-history-size-color {
background-color: @cryptpad_color_grey_500;
@ -159,6 +163,7 @@
align-items: center;
padding: 5px 0;
outline: none;
border-radius: @variables_radius;
& > i {
margin-left: @snapshot_spacing;
text-align: center;

@ -24,12 +24,14 @@
background: @cp_sidebar-left-bg;
display: flex;
flex-flow: column;
padding: 0px 5px;
.cp-sidebarlayout-categories {
flex: 1;
.cp-sidebarlayout-category {
display: flex;
align-items: center;
.leftside-menu-category_main();
box-shadow: @cryptpad_ui_shadow;
}
}
&.cp-leftside-narrow {
@ -111,10 +113,12 @@
//border-radius: 0.25em 0 0 0.25em;
border: 1px solid @cryptpad_color_grey_500;
border-right: 0px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
}
button {
//border-radius: 0 0.25em 0.25em 0;
//border: 1px solid #adadad;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
border-left: 0px;
height: 40px;
margin: 0 !important;

@ -42,10 +42,11 @@
width: 1200px;
max-width: 90%;
margin: 5px auto;
border-radius: @variables_radius;
.cp-support-list-message {
background-color: @msg-bg;
margin: 2px;
padding: 2px 5px;
padding: 5px 5px;
border-radius: @variables_radius;
.cp-support-fromme {
background-color: @fromme-bg;
}
@ -73,6 +74,7 @@
.cp-support-list-actions {
display: flex;
order: 3;
margin-top: 5px;
.cp-support-hide {
display: none;
}

@ -1,4 +1,5 @@
@import (reference) './colortheme-all.less';
@import (reference) './variables.less';
.tippy_main() {
--LessLoader_require: LessLoader_currentFile();
@ -6,7 +7,7 @@
& {
.tippy-tooltip.cryptpad-theme {
background-color: @cp_tooltip-bg;
border-radius: 0px;
border-radius: @variables_radius;
color: @cp_tooltip-fg;
overflow-wrap: break-word;
[x-circle] {

@ -1,5 +1,6 @@
@import (reference) "./colortheme-all.less";
@import (reference) "./tools.less";
@import (reference) "./variables.less";
.tokenfield_main () {
--LessLoader_require: LessLoader_currentFile();
@ -35,6 +36,12 @@
flex: 1;
min-width: 0 !important;
}
button {
// no radius in input + button combo
// input .token-input is styled at the bottom of this file
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
}
}
.token {
box-sizing: border-box;
@ -45,6 +52,7 @@
margin: 2px 0;
margin-right: 5px;
height: 24px;
border-radius: @variables_radius;
vertical-align: middle;
cursor: default;
color: @cp_token-fg;
@ -92,6 +100,8 @@
max-width: 100%;
width: 100%;
min-width: 100% !important;
border-top-right-radius: 0px !important;
border-bottom-right-radius: 0px !important;
&:focus {
outline: 0;
box-shadow: none;

@ -1,4 +1,5 @@
@import (reference) "./colortheme-all.less";
@import (reference) "./variables.less";
.history_main () {
--LessLoader_require: LessLoader_currentFile();
@ -88,13 +89,20 @@
}
button {
margin: 0 5px;
border: 1px solid @cryptpad_text_col;
border: 1px solid @cp_toolbar-fg;
background-color: @cp_toolbar-bg;
color: @cp_toolbar-fg;
border-radius: @variables_radius;
text-transform: uppercase;
display: inline-flex;
align-items: center;
.fa:not(:last-child) {
margin-right: 5px;
}
&:hover {
// XXX DB: check hover in light/dark themes
background-color: fade(@cp_toolbar-fg, 30%);
}
&:disabled {
cursor: not-allowed !important;
opacity: 0.6;
@ -233,9 +241,11 @@
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 40px;
margin: 5px 0px 5px 40px;
button {
width: 50px;
color: @cp_toolbar-fg;
border-radius: @variables_radius;
.fa:first-child:not(:last-child) {
margin-right: 5px;
}

@ -15,9 +15,9 @@
@bg-color: @colortheme_apps[default], // color of the toolbar background
) {
@toolbar-bg-color: @bg-color;
@desat-color: desaturate(@bg-color, 20%);
@toolbar-bg-color-light: contrast(@cp_toolbar-fg, lighten(@bg-color, 30%), darken(@desat-color, 20%));
@toolbar-bg-color-active: contrast(@cp_toolbar-fg, lighten(@bg-color, 20%), darken(@desat-color, 10%));
// XXX: check contrasts of app colors used as btn background
@toolbar-bg-color-light: lighten(@bg-color, 30%);
@toolbar-bg-color-fade: fade(@toolbar-bg-color-light, 60%);
};
.toolbar_main (
@ -27,8 +27,8 @@
.toolbar_vars(@bg-color);
--toolbar-bg-color: @toolbar-bg-color;
--toolbar-bg-color-fade: @toolbar-bg-color-fade;
--toolbar-bg-color-light: @toolbar-bg-color-light;
--toolbar-bg-color-active: @toolbar-bg-color-active;
.help_main();
.notifications_main();
@ -108,6 +108,7 @@
}
.cp-toolbar-chat-drawer {
border-radius: @variables_radius;
background-color: @toolbar-bg-color;
background-color: var(--toolbar-bg-color);
font: @colortheme_app-font-size @colortheme_font;
@ -392,7 +393,6 @@
//display: inline-block;
button {
height: 100%;
border-radius: 0;
margin: 0;
background: transparent;
}
@ -503,9 +503,12 @@
.cp-toolbar-link {
height: @toolbar_line-height;
width: @toolbar_line-height;
transform: scale(0.5);
//transform: scale(0.5);
.cp-toolbar-link-logo {
padding: 5px;
span {
font-size: 24px;
}
}
}
.cp-toolbar-user {
@ -514,21 +517,26 @@
height: @toolbar_line-height;
width: @toolbar_line-height;
margin-left: 0;
padding: 0px;
button {
height: @toolbar_line-height;
width: @toolbar_line-height;
font-size: 15px;
margin-top: -1px;
.cp-dropdown-button-title {
transform: scale(0.5);
bottom: -5px;
right: -5px;
&::before {
padding-top: 1px;
}
// .cp-dropdown-button-title {
// transform: scale(0.5);
// bottom: -5px;
// right: -5px;
// }
}
}
.cp-toolbar-user-dropdown {
height: @toolbar_line-height;
width: @toolbar_line-height;
padding: 0;
&> button {
height: @toolbar_line-height;
width: @toolbar_line-height;
@ -638,6 +646,7 @@
align-items: center;
font-size: 20px;
vertical-align: middle;
border-radius: 0 @variables_radius @variables_radius 0;
.fa {
font-size: 20px;
}
@ -677,6 +686,7 @@
}
.cp-toolbar-title-editable {
cursor: text;
border-radius: @variables_radius 0 0 @variables_radius;
}
}
}
@ -723,7 +733,7 @@
line-height: @toolbar_top-height;
width: @toolbar_top-height;
height: @toolbar_top-height;
padding: 0;
padding: 5px;
box-sizing: border-box;
display: inline-block;
}
@ -735,9 +745,10 @@
display: flex;
align-items: center;
justify-content: center;
width: @toolbar_top-height;
width: @toolbar_top-height - 10px;
font-size: 1em;
height: @toolbar_top-height;
height: @toolbar_top-height - 10px;
border-radius: @variables_radius;
padding: 0px;
margin: 0;
&::before {
@ -795,22 +806,41 @@
text-decoration: none;
height: auto;
padding: 10px;
color: @toolbar-bg-color;
color: var(--toolbar-bg-color);
svg {
#outline, #squares {
fill: @toolbar-bg-color;
fill: var(--toolbar-bg-color);
span {
font-size: 45px;
}
#background {
fill: @cp_toolbar-logo-bg;
&:hover {
// Icons shown when hovering the toolbar icon (where logo used to be)
.cptools::before {
content: "\e920"; // shows drive icon in document toolbars
}
.fa::before {
content: "\f0a0"; // shows hdd-o for all FA icons (settings, etc)
}
.fa-hdd-o::before {
content: "\f015"; // shows home for drive
}
img {
cursor: pointer;
height: 100%;
width: 100%;
}
// svg {
// #outline, #squares {
// fill: @toolbar-bg-color;
// fill: var(--toolbar-bg-color);
// }
// #background {
// fill: @cp_toolbar-logo-bg;
// }
// }
// img {
// cursor: pointer;
// height: 100%;
// width: 100%;
// }
}
}
.cp-toolbar-user {
@ -828,21 +858,10 @@
}
.cp-toolbar-user-dropdown {
z-index: 10000; //Z cp-toolbar-user-dropdown
//margin-left: 20px;
height: @toolbar_top-height;
width: @toolbar_top-height;
padding: 0px;
padding: 5px;
box-sizing: border-box;
text-align: center;
/*
background-color: rgba(0,0,0,0.3);
transition: all 0.15s;
&:hover {
background-color: rgba(0,0,0,0.4);
}
*/
.cp-dropdown-content {
margin: 0;
padding-bottom: 10px;
@ -851,8 +870,9 @@
display: flex;
justify-content: center;
align-items: center;
height: @toolbar_top-height;
width: @toolbar_top-height;
height: @toolbar_top-height - 10px;
width: @toolbar_top-height - 10px;
border-radius: @variables_radius;
padding: 0;
&:hover {
border-color: transparent;
@ -876,6 +896,19 @@
}
}
}
.cp-user-menu-logo {
text-align: left;
font-family: "IBM Plex Mono";
color: @cryptpad_color_grey_500;
font-size: 1.5em;
padding: 5px;
img {
width: 25px;
}
.cp-user-menu-logo-text {
margin-left: 10px;
}
}
p.cp-toolbar-account {
&> span {
font-weight: bold;
@ -896,8 +929,8 @@
}
.cp-toolbar-history, .cp-toolbar-snapshots {
background-color: @toolbar-bg-color-light;
background-color: var(--toolbar-bg-color-light);
background-color: @cp_toolbar-bg;
//background-color: var(--toolbar-bg-color-light);
color: @toolbar-color;
}
.cp-toolbar-snapshots {
@ -935,24 +968,9 @@
}
}
.cp-toolbar-bottom {
background-color: @toolbar-bg-color-light;
background-color: var(--toolbar-bg-color-light);
color: @cp_toolbar-bottom-fg;
button:hover, button.cp-toolbar-button-active {
background-color: @toolbar-bg-color-active;
background-color: var(--toolbar-bg-color-active);
}
button.cp-toolbar-button-active {
border-color: @toolbar-bg-color-active;
border-color: var(--toolbar-bg-color-active);
}
button:hover, button:focus {
border-color: @toolbar-bg-color-active;
border-color: var(--toolbar-bg-color-active);
//border-color: @cryptpad_text_col;
}
display: inline-flex;
margin: 5px 0px;
align-items: center;
justify-content: space-between;
max-width: 100%;
@ -967,18 +985,57 @@
margin: 5px 0px;
}
}
button {
border: 1px solid transparent;
border: 1px solid @cp_toolbar-bottom-bg;
box-sizing: border-box;
position: relative;
margin: 0px;
border-radius: 0;
border-radius: @variables_radius;
height: @toolbar_line-height;
display: inline-flex;
align-items: center;
.fa, .cptools {
margin-right: 5px;
}
&:hover {
background-color: fade(@cp_toolbar-bottom-bg, 70%);
}
}
.cp-toolbar-bottom-left > button,
.cp-toolbar-bottom-mid > button,
.cp-toolbar-bottom-right > button,
.cp-toolbar-bottom-right > span > button {
background-color: @cp_toolbar-bottom-bg;
color: @cp_toolbar-bottom-fg;
&:hover {
background-color: fade(@cryptpad_text_col, 20%);
border-color: @cryptpad_text_col;
color: @cryptpad_text_col;
}
&.cp-toolbar-button-active {
background-color: @cp_toolbar-bg;
border-color: @cp_toolbar-fg;
color: @cp_toolbar-fg;
&:hover {
background-color: fade(@cryptpad_text_col, 20%);
}
}
}
button.cp-toolbar-button-primary {
background-color: @toolbar-bg-color-light;
background-color: var(--toolbar-bg-color-light);
border-color: @toolbar-bg-color-light;
border-color: var(--toolbar-bg-color-light);
color: @cp_toolbar-bottom-fg;
&:hover {
background-color: @toolbar-bg-color-fade;
background-color: var(--toolbar-bg-color-fade);
border-color: @toolbar-bg-color-fade;
border-color: var(--toolbar-bg-color-fade);
color: @cp_toolbar-bottom-fg;
}
}
button.cp-toolbar-collapse {
/*
@ -988,10 +1045,24 @@
is very small, which makes it unlikely that you'll see the title unless
you hover perfectly. The same is true of the drive's grid/list view toggle.
*/
position: relative;
.fa {
margin-right: 0px;
}
.cp-collapsed-notif {
display: inline-block;
width: 12px;
height: 12px;
background-color: @cryptpad_color_red;
position: absolute;
bottom: -3px;
right: -3px;
border: 2px solid @cp_toolbar-bg;
border-radius: 50%;
}
&:not(.cp-toolbar-button-active) .cp-collapsed-notif {
display: none;
}
}
&.cp-toolbar-small {
@ -1013,14 +1084,25 @@
.cp-toolbar-bottom-left {
display: flex;
order: 1;
padding-left: 5px;
button {
margin-right: 5px;
}
}
.cp-toolbar-bottom-mid {
display: flex;
order: 2;
button {
margin-right: 5px;
}
}
.cp-toolbar-bottom-right {
order: 3;
display: flex;
padding-right: 5px;
button {
margin-left: 5px;
}
#cp-toolbar-chat-drawer-open { order: 0; }
#cp-toolbar-userlist-drawer-open { order: 1; }
& > .cp-dropdown-container {
@ -1081,6 +1163,7 @@
}
.cp-toolbar-drawer-content {
box-shadow: 0px 1px 5px 0px @cp_shadow-color;
border-radius: @variables_radius;
overflow-y: auto;
overflow-x: hidden;
&.cp-dropdown-visible {
@ -1089,7 +1172,8 @@
position: absolute;
left: 0px;
top: @toolbar_line-height;
margin: -1px;
//margin: -1px;
padding: 5px;
min-width: 50px;
background: @cp_dropdown-bg;
display: flex;
@ -1105,15 +1189,15 @@
box-sizing: border-box;
min-width: 150px;
height: @toolbar_line-height;
border-radius: 0;
border-radius: @variables_radius;
border: 0;
}
button {
white-space: nowrap;
padding: 5px 16px;
padding: 5px;
text-align: left;
margin: 0;
border-radius: 0;
border-radius: @variables_radius;
border: 0;
width: 100%;
line-height: 1em;

@ -1,6 +1,7 @@
@import (reference) "./colortheme-all.less";
@import (reference) "./avatar.less";
@import (reference) "./tools.less";
@import (reference) "./variables.less";
.usergrid_main() {
--LessLoader_require: LessLoader_currentFile();
@ -52,6 +53,7 @@
justify-content: center;
align-items: center;
padding: 5px;
border-radius: @variables_radius;
margin: 3px !important;
cursor: default;
transition: order 0.5s, background-color 0.5s;

@ -10,3 +10,8 @@
// Used in modal.less and alertify.less
@variables_padding: 12px;
@variables_shadow: 0 8px 32px 0 @cp_shadow-color;
// Rounded corners
@variables_radius: 5px;
@variables_radius_L: 10px;

@ -11,14 +11,21 @@
.cp-container {
.cp-iconCont {
text-align: center;
&.align-items-center {
justify-content: center;
}
h4 {
margin-top: 1.5em;
margin-bottom: 1.5em;
}
p.center {
text-align: center;
}
div {
.card {
a.card {
.cp-shadow();
border-radius: 0;
border-radius: @infopages-radius-L;
margin-bottom: 1em;
border: 0;
background-color: @cp_static-card-bg;
@ -53,6 +60,34 @@
font-size: 1.3em;
}
}
a.card-small {
.cp-shadow();
border-radius: @infopages-radius-L;
display: inline-block;
background-color: @cp_static-card-bg;
margin: 15px;
.card-body {
padding: 10px;
p {
display: flex;
flex-flow: row;
justify-content: center;
align-items: center;
margin: 0;
height: 100%;
font-size: 1.3em;
}
}
img {
width: 40px;
margin: 0 10px 0 0;
}
&:hover, &:focus {
text-decoration: none;
color: @cryptpad_text_col;
background-color: @cryptpad_color_brand_fadest;
}
}
}
}
}

@ -22,10 +22,11 @@
.cp-shadow();
border: none;
background-color: @cp_static-card-bg;
border-radius: 0px;;
border-radius: @infopages-radius;
.title-card {
background-color: @cryptpad_color_brand;
padding: 20px;
border-radius: @infopages-radius @infopages-radius 0 0;
}
.card-body, .title-card {
display: flex;

@ -10,21 +10,20 @@
flex-direction: column;
justify-content: space-between;
align-items: center;
.container {
@media only screen and (max-device-width : 576px) {
margin-top: 6em;
}
.alert-info {
font-size: 16px;
background-color: @cp_alerts-info-bg;
color: @cp_alerts-info-text;
}
& > .cp-container {
flex: 1;
display: flex;
flex-flow: column;
justify-content: space-around;
justify-content: space-evenly;
.alert-info {
font-size: 16px;
border-radius: 0px;
}
max-width: 1000vh;
}
}
body {
@ -32,35 +31,61 @@
color: @cryptpad_text_col;
}
h1.cp-instance-title {
text-align: center;
font-family: "IBM Plex Mono";
font-weight: 500;
color: @cryptpad_color_brand;
font-size: 2.8rem;
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-word;
}
.cp-home-hero {
width: 100%;
margin-bottom: 50px;
align-self: center;
align-items: center;
justify-content: flex-end;
@media screen and (max-width: 990px) {
justify-content: center;
}
}
.cp-title {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
color: @cryptpad_color_brand;
margin-top: 1.5em;
margin: 0 auto;
flex-grow: 1;
max-width: unset;
img {
max-width: 200px;
margin-bottom: 1.5em;
}
margin-left: 0;
h1 {
font-family: "IBM Plex Mono";
font-weight: 500;
//font-family: Garamond, Baskerville, "Baskerville Old Face", "Hoefler Text", "Times New Roman", Times, serif;
//font-family: "Raleway";
color: @cryptpad_color_brand;
font-size: 3.7rem;
}
.tag-line {
text-align: center;
font-size: 1.4em;
color: @cp_static-link;
}
.cp-instance-location {
margin-top: 20px;
i {
font-size: 1.2em;
margin-right: 5px;
}
}
.cp-instance-links {
padding: 1.3rem;
a {
margin: 1.3rem;
}
}
}
@ -69,15 +94,36 @@
text-decoration: none;
}
.cp-apps {
max-width: 575px;
@media screen and (max-width: 990px) {
align-self: baseline;
}
}
.cp-app-grid {
background-color: @cp_alertify-bg;
border-radius: @infopages-radius-L;
padding: 15px;
box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
.cp-app-new {
font-size: 1.4em;
line-height: 100%;
color: fade(@cryptpad_text_col, 80%);
i {
margin-right: 5px;
}
}
.cp-app-grid-apps {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
justify-content: space-between;
padding: 0 0.8rem;
}
a {
margin: 10px;
text-decoration: none;
}
@media screen and (max-width: 768px) {
@media screen and (max-width: 990px) {
margin-top: 40px;
}
}
@ -153,6 +199,7 @@
each(@colortheme_apps, {
.cp-callout-@{key} {
border-radius: @infopages-radius;
i { color: @value; }
&:hover {
@desat: desaturate(@value, 15%);
@ -161,6 +208,55 @@
}
}
});
.cp-app-drive {
display: flex;
flex-direction: row;
margin: 20px 0px;
// font-size: 1.4rem;
a.cp-drive-btn {
color: @cryptpad_text_col;
font-size: 1.5rem;
display: block;
height: min-content;
flex-shrink: 0;
width: fit-content;
padding: 10px;
border-radius: @infopages-radius-L;
margin-right: 25px;
&:visited {
color: @cryptpad_text_col;
}
&:hover {
background-color: fade(@cryptpad_text_col, 10%);
}
i {
color: @cryptpad_color_brand;
margin-right: 10px;
font-size: 1.3em;
}
}
.cp-sub-prompt {
* {
display: block;
}
button {
background-color: @cryptpad_color_link;
color: @cryptpad_text_col_inv;
font-size: 1.4rem;
margin: 10px 0;
border-radius: @infopages-radius-L;
padding: 0.75rem;
i {
display: inline;
margin-right: 10px;
}
&:hover, &:focus {
background-color: @cp_static-card-bg;
color: @cryptpad_text_col;
}
}
}
}
.cp-hidden { display: none !important; }
.cp-callout-more {

@ -23,11 +23,16 @@
.cp-shadow();
background-color: @cp_static-card-bg;
padding: 10px;
margin: 0 10px 10px 10px;
border-radius: @infopages-radius-L;
.cp-login-instance {
margin-bottom: 10px;
}
.form-control {
border-radius: 0;
border-radius: @infopages-radius;
color: @cryptpad_text_col;
background-color: @cp_forms-bg;
margin-bottom: 5px;
margin-bottom: 10px;
&:focus {
border-color: @cryptpad_color_brand;
}
@ -43,14 +48,8 @@
}
.extra {
margin-top: 1em;
#register {
border-color: @cryptpad_color_brand;
background: @cryptpad_color_white;
color: @cryptpad_color_brand;
padding: 10px;
border-radius: 0;
margin: 0px;
button.login {
margin-right: 0px;
}
}
}

@ -13,13 +13,9 @@
.cp-container {
.form-group {
.checkbox-container {
&:nth-of-type(1) {
margin-top: 2em;
}
&:last-of-type {
margin-bottom: 1em;
}
.cp-register-instance {
text-align: center;
margin-bottom: 10px;
}
#register {
&.btn {
@ -85,12 +81,13 @@
position: relative;
z-index: 2;
margin-bottom: 100px;
border-radius: @infopages-radius-L;
.cp-shadow();
.form-control {
border-radius: 0;
border-radius: @infopages-radius;
color: @cryptpad_text_col;
background-color: @cp_forms-bg;
margin-top: 5px;
margin-bottom: 10px;
&:focus {
border-color: @cryptpad_color_brand;
}
@ -100,7 +97,7 @@
color: @cryptpad_text_col;
}
button#register {
margin: 0px;
margin-top: 10px;
}
}
@ -119,7 +116,7 @@
content: "\f071";
}
.red {
color: @cryptpad_color_red;
background-color: @cp_static-danger;
}
}
}

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html class="cp">
<!-- If this file is not called customize.dist/src/template.html, it is generated -->
<head>
<title data-localization="main_title">CryptPad: Collaboration suite, encrypted and open-source</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" type="image/png" href="/customize/favicon/main-favicon.png" id="favicon"/>
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
</head>
<body class="html">
<noscript>
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
</noscript>
</html>

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html class="cp">
<!-- If this file is not called customize.dist/src/template.html, it is generated -->
<head>
<title data-localization="main_title">CryptPad: Collaboration suite, encrypted and open-source</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" type="image/png" href="/customize/favicon/main-favicon.png" id="favicon"/>
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
</head>
<body class="html">
<noscript>
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
</noscript>
</html>

@ -183,7 +183,7 @@ server {
# /api/config is loaded once per page load and is used to retrieve
# the caching variable which is applied to every other resource
# which is loaded during that session.
location ~ ^/api/(config|broadcast).*$ {
location ~ ^/api/.*$ {
proxy_pass http://localhost:3000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;

@ -359,6 +359,7 @@ var instanceStatus = function (Env, Server, cb) {
instanceDescription: Env.instanceDescription,
instanceJurisdiction: Env.instanceJurisdiction,
instanceName: Env.instanceName,
instanceNotice: Env.instanceNotice,
});
};

@ -43,8 +43,11 @@ PROVIDE_AGGREGATE_STATISTICS
REMOVE_DONATE_BUTTON
BLOCK_DAILY_CHECK
// Customized instance info
SET_INSTANCE_JURISDICTION
SET_INSTANCE_DESCRIPTION
SET_INSTANCE_NAME
SET_INSTANCE_NOTICE
NOT IMPLEMENTED:
@ -196,14 +199,45 @@ commands.SET_SUPPORT_MAILBOX = makeGenericSetter('supportMailbox', function (arg
// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_INSTANCE_PURPOSE', ["development"]]], console.log)
commands.SET_INSTANCE_PURPOSE = makeGenericSetter('instancePurpose', args_isString);
var makeTranslation = function (attr) {
return function (Env, args) {
if (!Array.isArray(args)) { throw new Error("INVALID_ARGS"); }
var value = args[0];
var state = Env[attr];
if (typeof(value) === 'string') {
if (state.default === value) { return false; }
state.default = value;
return true;
}
if (value && typeof(value) === 'object') {
var changed = false;
Object.keys(value).forEach(function (lang) {
if (state[lang] === value[lang]) { return; }
state[lang] = value[lang];
changed = true;
});
return changed;
}
return false;
};
};
// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_INSTANCE_JURISDICTION', ['France']]], console.log)
commands.SET_INSTANCE_JURISDICTION = makeGenericSetter('instanceJurisdiction', args_isString);
// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_INSTANCE_JURISDICTION', [{default:'France',de:'Frankreich'}]]], console.log)
commands.SET_INSTANCE_JURISDICTION = makeTranslation('instanceJurisdiction');
// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_INSTANCE_NAME', ['My Personal CryptPad']]], console.log)
commands.SET_INSTANCE_NAME = makeGenericSetter('instanceDescription', args_isString);
// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_INSTANCE_NAME', [{default:'My Personal CryptPad', fr: "Mon CryptPad personnel"}]]], console.log)
commands.SET_INSTANCE_NAME = makeTranslation('instanceName');
// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_INSTANCE_DESCRIPTION', ['A personal instance, hosted for me and nobody else']]], console.log)
commands.SET_INSTANCE_DESCRIPTION = makeGenericSetter('instanceDescription', args_isString);
// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_INSTANCE_DESCRIPTION', [{default:'A personal server, not intended for public usage', fr: 'Un serveur personnel, non destiné à un usage public'}]]], console.log)
commands.SET_INSTANCE_DESCRIPTION = makeTranslation('instanceDescription');
// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_INSTANCE_NOTICE', ['Our hosting costs have increased during the pandemic. Please consider donating!']]], console.log)
// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_INSTANCE_NOTICE', [{default:'Our hosting costs have increased during the pandemic. Please consider donating!',fr:'Nos coûts d'hébergement ont augmenté pendant la pandémie. Veuillez envisager de faire un don !']]], console.log)
commands.SET_INSTANCE_NOTICE = makeTranslation('instanceNotice');
// Maintenance: Empty string or an object with a start and end time
var isNumber = function (value) {
@ -370,7 +404,7 @@ Decrees.load = function (Env, _cb) {
try {
handler(void 0, JSON.parse(text));
} catch (err) {
handler(err);
handler(err, text);
}
next();
}, function (err) {

@ -5,6 +5,7 @@ Default.commonCSP = function (Env) {
var sandbox = Env.httpSafeOrigin;
sandbox = (sandbox && sandbox !== domain? ' ' + sandbox: '');
// Content-Security-Policy
var accounts_api = Env.accounts_api? ' ' + Env.accounts_api: '';
return [
"default-src 'none'",
@ -25,7 +26,7 @@ Default.commonCSP = function (Env) {
if you are deploying to production, you'll probably want to remove
the ws://* directive
*/
"connect-src 'self' blob: " + (/^https:/.test(domain)? 'wss:': domain.replace('http://', 'ws://')) + ' ' + domain + sandbox,
"connect-src 'self' blob: " + (/^https:/.test(domain)? 'wss:': domain.replace('http://', 'ws://')) + ' ' + domain + sandbox + accounts_api,
// data: is used by codemirror
"img-src 'self' data: blob:" + domain,
@ -54,13 +55,11 @@ Default.httpHeaders = function (Env) {
"Permissions-policy":"interest-cohort=()"
};
};
Default.mainPages = function () {
return [
'index',
'privacy',
'terms',
'contact',
'what-is-cryptpad',
'features',
'maintenance'
];

@ -73,6 +73,7 @@ module.exports.create = function (config) {
fileHost: config.fileHost || undefined,
NO_SANDBOX: NO_SANDBOX,
httpSafePort: httpSafePort,
accounts_api: config.accounts_api || undefined, // this simplifies integration with an accounts page
shouldUpdateNode: !isRecentVersion(),
@ -192,9 +193,10 @@ module.exports.create = function (config) {
provideAggregateStatistics: false,
updateAvailable: undefined,
instanceName: '',
instanceDescription: '',
instanceJurisdiction: '',
instanceName: {},
instanceDescription: {},
instanceJurisdiction: {},
instanceNotice: {},
myDomain: config.myDomain,
mySubdomain: config.mySubdomain, // only exists for the accounts integration
@ -205,7 +207,7 @@ module.exports.create = function (config) {
maxWorkers: config.maxWorkers,
disableIntegratedTasks: config.disableIntegratedTasks || false,
disableIntegratedEviction: typeof(config.disableIntegratedEviction) === 'undefined'? true: config.disableIntegratedEviction, // XXX 4.11.0 false,
disableIntegratedEviction: typeof(config.disableIntegratedEviction) === 'undefined'? true: config.disableIntegratedEviction,
lastEviction: +new Date(),
evictionReport: {},
commandTimers: {},

@ -1,12 +1,12 @@
{
"name": "cryptpad",
"version": "4.14.1",
"version": "5.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "cryptpad",
"version": "4.14.1",
"version": "5.0.0",
"license": "AGPL-3.0+",
"dependencies": {
"@mcrowe/minibloom": "^0.2.0",
@ -80,9 +80,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "17.0.23",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz",
"integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==",
"version": "17.0.33",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.33.tgz",
"integrity": "sha512-miWq2m2FiQZmaHfdZNcbpp9PuXg34W5JZ5CrJ/BaS70VuhoJENBEQybeiYSaPBRNq6KQGnjfEnc/F3PN++D+XQ==",
"dev": true
},
"node_modules/accepts": {
@ -126,7 +126,7 @@
"node_modules/arr-diff": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
"integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
"integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==",
"dev": true,
"engines": {
"node": ">=0.10.0"
@ -144,7 +144,7 @@
"node_modules/arr-union": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
"integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
"integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==",
"dev": true,
"engines": {
"node": ">=0.10.0"
@ -158,7 +158,7 @@
"node_modules/array-union": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
"integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
"integrity": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==",
"dev": true,
"dependencies": {
"array-uniq": "^1.0.1"
@ -170,7 +170,7 @@
"node_modules/array-uniq": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
"integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=",
"integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==",
"dev": true,
"engines": {
"node": ">=0.10.0"
@ -179,7 +179,7 @@
"node_modules/array-unique": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
"integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
"integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==",
"dev": true,
"engines": {
"node": ">=0.10.0"
@ -188,7 +188,7 @@
"node_modules/asap": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=",
"integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==",
"dev": true,
"optional": true
},
@ -205,7 +205,7 @@
"node_modules/assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
"integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==",
"dev": true,
"optional": true,
"engines": {
@ -215,7 +215,7 @@
"node_modules/assign-symbols": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
"integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
"integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==",
"dev": true,
"engines": {
"node": ">=0.10.0"
@ -229,7 +229,7 @@
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true,
"optional": true
},
@ -248,7 +248,7 @@
"node_modules/aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=",
"integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==",
"dev": true,
"optional": true,
"engines": {
@ -301,7 +301,7 @@
"node_modules/bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
"integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==",
"dev": true,
"optional": true,
"dependencies": {
@ -418,13 +418,13 @@
"node_modules/call-me-maybe": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz",
"integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=",
"integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==",
"dev": true
},
"node_modules/caller-callsite": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz",
"integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=",
"integrity": "sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ==",
"dev": true,
"dependencies": {
"callsites": "^2.0.0"
@ -436,7 +436,7 @@
"node_modules/caller-path": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz",
"integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=",
"integrity": "sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A==",
"dev": true,
"dependencies": {
"caller-callsite": "^2.0.0"
@ -448,7 +448,7 @@
"node_modules/callsites": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz",
"integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=",
"integrity": "sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==",
"dev": true,
"engines": {
"node": ">=4"
@ -457,7 +457,7 @@
"node_modules/caseless": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
"integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==",
"dev": true,
"optional": true
},
@ -581,7 +581,7 @@
"node_modules/cli": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz",
"integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=",
"integrity": "sha512-41U72MB56TfUMGndAKK8vJ78eooOD4Z5NOL4xEfjc0c23s+6EYKXlXsmACBVclLP1yOfWCgEganVzddVrSNoTg==",
"dev": true,
"dependencies": {
"exit": "0.1.2",
@ -810,9 +810,9 @@
}
},
"node_modules/dom-serializer/node_modules/domelementtype": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
"integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
"integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
"dev": true,
"funding": [
{
@ -1395,15 +1395,15 @@
}
},
"node_modules/glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"dev": true,
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
@ -1442,6 +1442,18 @@
"integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=",
"dev": true
},
"node_modules/glob/node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dev": true,
"dependencies": {
"brace-expansion": "^1.1.7"
},
"engines": {
"node": "*"
}
},
"node_modules/globby": {
"version": "9.2.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz",
@ -3701,9 +3713,9 @@
"dev": true
},
"@types/node": {
"version": "17.0.23",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz",
"integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==",
"version": "17.0.33",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.33.tgz",
"integrity": "sha512-miWq2m2FiQZmaHfdZNcbpp9PuXg34W5JZ5CrJ/BaS70VuhoJENBEQybeiYSaPBRNq6KQGnjfEnc/F3PN++D+XQ==",
"dev": true
},
"accepts": {
@ -3740,7 +3752,7 @@
"arr-diff": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
"integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
"integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==",
"dev": true
},
"arr-flatten": {
@ -3752,7 +3764,7 @@
"arr-union": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
"integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
"integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==",
"dev": true
},
"array-flatten": {
@ -3763,7 +3775,7 @@
"array-union": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
"integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
"integrity": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==",
"dev": true,
"requires": {
"array-uniq": "^1.0.1"
@ -3772,19 +3784,19 @@
"array-uniq": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
"integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=",
"integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==",
"dev": true
},
"array-unique": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
"integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
"integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==",
"dev": true
},
"asap": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=",
"integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==",
"dev": true,
"optional": true
},
@ -3801,14 +3813,14 @@
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
"integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==",
"dev": true,
"optional": true
},
"assign-symbols": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
"integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
"integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==",
"dev": true
},
"async-limiter": {
@ -3819,7 +3831,7 @@
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true,
"optional": true
},
@ -3832,7 +3844,7 @@
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=",
"integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==",
"dev": true,
"optional": true
},
@ -3878,7 +3890,7 @@
"bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
"integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==",
"dev": true,
"optional": true,
"requires": {
@ -3981,13 +3993,13 @@
"call-me-maybe": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz",
"integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=",
"integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==",
"dev": true
},
"caller-callsite": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz",
"integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=",
"integrity": "sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ==",
"dev": true,
"requires": {
"callsites": "^2.0.0"
@ -3996,7 +4008,7 @@
"caller-path": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz",
"integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=",
"integrity": "sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A==",
"dev": true,
"requires": {
"caller-callsite": "^2.0.0"
@ -4005,13 +4017,13 @@
"callsites": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz",
"integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=",
"integrity": "sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==",
"dev": true
},
"caseless": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
"integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==",
"dev": true,
"optional": true
},
@ -4117,7 +4129,7 @@
"cli": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz",
"integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=",
"integrity": "sha512-41U72MB56TfUMGndAKK8vJ78eooOD4Z5NOL4xEfjc0c23s+6EYKXlXsmACBVclLP1yOfWCgEganVzddVrSNoTg==",
"dev": true,
"requires": {
"exit": "0.1.2",
@ -4298,9 +4310,9 @@
},
"dependencies": {
"domelementtype": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
"integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
"integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
"dev": true
},
"entities": {
@ -4773,17 +4785,28 @@
}
},
"glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"dependencies": {
"minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
}
}
},
"glob-parent": {

@ -1,7 +1,7 @@
{
"name": "cryptpad",
"description": "realtime collaborative visual editor with zero knowlege server",
"version": "4.14.1",
"version": "5.0.0",
"license": "AGPL-3.0+",
"repository": {
"type": "git",
@ -49,7 +49,7 @@
"unused-translations": "node ./scripts/translations/unused-translations.js",
"test": "node scripts/TestSelenium.js",
"test-rpc": "cd scripts/tests && node test-rpc",
"template": "cd customize.dist/src && for page in ../index.html ../privacy.html ../terms.html ../contact.html ../what-is-cryptpad.html ../features.html ../../www/login/index.html ../../www/register/index.html ../../www/user/index.html;do echo $page; cp template.html $page; done;",
"template": "cd customize.dist/src && for page in ../index.html ../contact.html ../features.html ../../www/login/index.html ../../www/register/index.html ../../www/user/index.html;do echo $page; cp template.html $page; done;",
"evict-inactive": "node scripts/evict-inactive.js"
}
}

@ -18,11 +18,13 @@ var simpleTags = [
'</span>',
];
['a', 'b', 'em', 'p', 'i', 'code', 'li',].forEach(function (tag) {
['a', 'b', 'em',/* 'p',*/ 'i', 'code', 'li',].forEach(function (tag) {
simpleTags.push('<' + tag + '>');
simpleTags.push('</' + tag + '>');
});
var found_tags = {};
// these keys are known to be problematic
var KNOWN_ISSUES = [ // FIXME
//'newVersion',
@ -67,7 +69,10 @@ var processLang = function (map, lang, primary) {
var usesHTML;
s.replace(/<[\s\S]*?>/g, function (html) {
if (simpleTags.indexOf(html) !== -1) { return; }
if (simpleTags.includes(html)) {
found_tags[html] = 1;
return;
}
announce();
usesHTML = true;
if (!primary) {
@ -115,6 +120,7 @@ processLang(EN, 'en', true);
'sv',
//'te',
'tr',
'uk',
'zh',
].forEach(function (lang) {
try {
@ -125,3 +131,8 @@ processLang(EN, 'en', true);
console.error(err);
}
});
simpleTags.forEach(html => {
if (found_tags[html]) { return; }
console.log(`html exemption '${html}' is unnecessary.`);
});

@ -237,6 +237,7 @@ var serveConfig = makeRouteCache(function (host) {
enableEmbedding: Env.enableEmbedding,
fileHost: Env.fileHost,
shouldUpdateNode: Env.shouldUpdateNode || undefined,
listMyInstance: Env.listMyInstance,
}, null, '\t'),
'});'
].join(';\n')
@ -261,6 +262,22 @@ var serveBroadcast = makeRouteCache(function (host) {
app.get('/api/config', serveConfig);
app.get('/api/broadcast', serveBroadcast);
var define = function (obj) {
return `define(function (){
return ${JSON.stringify(obj, null, '\t')};
});`
};
app.get('/api/instance', function (req, res) { // XXX use caching?
res.setHeader('Content-Type', 'text/javascript');
res.send(define({
name: Env.instanceName,
description: Env.instanceDescription,
location: Env.instanceJurisdiction,
notice: Env.instanceNotice,
}));
});
var four04_path = Path.resolve(__dirname + '/customize.dist/404.html');
var fivehundred_path = Path.resolve(__dirname + '/customize.dist/500.html');
var custom_four04_path = Path.resolve(__dirname + '/customize/404.html');

@ -39,8 +39,7 @@
}
}
.cp-admin-setlimit-form,
.cp-admin-setjurisdiction-form,
.cp-admin-setdescription-form {
.cp-admin-setter {
+ button {
margin-top: 5px !important;
}
@ -208,11 +207,6 @@
input.cp-admin-inval {
border-color: red !important;
}
input[type="text"], textarea {
&.cp-listing-info[disabled] {
border: 1px solid transparent !important; //1px solid transparent !imprortant;;//none !important;
}
}
.cp-admin-nopassword {
.cp-admin-pw {

@ -62,6 +62,7 @@ define([
'cp-admin-name',
'cp-admin-description',
'cp-admin-jurisdiction',
'cp-admin-notice',
],
'quota': [ // Msg.admin_cat_quota
'cp-admin-defaultlimit',
@ -389,7 +390,6 @@ define([
},
});
// XXX remove emailButton
create['email'] = function () {
var key = 'email';
var $div = makeBlock(key, true); // Msg.admin_emailHint, Msg.admin_emailTitle
@ -400,7 +400,7 @@ define([
value: ApiConfig.adminEmail || ''
});
var $input = $(input);
var innerDiv = h('div.cp-admin-setlimit-form', input);
var innerDiv = h('div.cp-admin-setter.cp-admin-setlimit-form', input);
var spinner = UI.makeSpinner($(innerDiv));
$button.click(function () {
@ -429,18 +429,28 @@ define([
return $div;
};
create['jurisdiction'] = function () {
var getInstanceString = function (attr) {
var val = APP.instanceStatus[attr];
var type = typeof(val);
switch (type) {
case 'string': return val || '';
case 'object': return val.default || '';
default: return '';
}
};
create['jurisdiction'] = function () { // TODO make translateable
var key = 'jurisdiction';
var $div = makeBlock(key, true); // Msg.admin_jurisdictionHint, Msg.admin_jurisdictionTitle, Msg.admin_jurisdictionButton
var $button = $div.find('button').addClass('cp-listing-action').text(Messages.settings_save);
var input = h('input.cp-listing-info', {
var input = h('input', {
type: 'text',
value: APP.instanceStatus.instanceJurisdiction || '',
value: getInstanceString('instanceJurisdiction'),
placeholder: Messages.owner_unknownUser || '',
});
var $input = $(input);
var innerDiv = h('div.cp-admin-setjurisdiction-form', input);
var innerDiv = h('div.cp-admin-setter', input);
var spinner = UI.makeSpinner($(innerDiv));
$button.click(function () {
@ -468,6 +478,46 @@ define([
return $div;
};
create['notice'] = function () { // TODO make translateable
var key = 'notice';
var $div = makeBlock(key, true); // Messages.admin_noticeHint
var $button = $div.find('button').addClass('cp-listing-action').text(Messages.settings_save);
var input = h('input', {
type: 'text',
value: getInstanceString('instanceNotice'),
placeholder: '',
});
var $input = $(input);
var innerDiv = h('div.cp-admin-setter', input);
var spinner = UI.makeSpinner($(innerDiv));
$button.click(function () {
spinner.spin();
$button.attr('disabled', 'disabled');
sFrameChan.query('Q_ADMIN_RPC', {
cmd: 'ADMIN_DECREE',
data: ['SET_INSTANCE_NOTICE', [$input.val().trim()]]
}, function (e, response) {
$button.removeAttr('disabled');
spinner.hide();
if (e || response.error) {
UI.warn(Messages.error);
$input.val('');
console.error(e, response);
return;
}
UI.log(Messages._getKey('ui_saved', [Messages.admin_noticeTitle]));
});
});
$button.before(innerDiv);
return $div;
};
create['instance-info-notice'] = function () {
return $(h('div.cp-admin-instance-info-notice.cp-sidebarlayout-element',
h('div.alert.alert-info.cp-admin-bigger-alert', [
@ -478,20 +528,19 @@ define([
));
};
create['name'] = function () {
create['name'] = function () { // TODO make translateable
var key = 'name';
var $div = makeBlock(key, true);
// Msg.admin_nameHint, Msg.admin_nameTitle, Msg.admin_nameButton
var $button = $div.find('button').addClass('cp-listing-action').text(Messages.settings_save);
var input = h('input.cp-listing-info', {
var input = h('input', {
type: 'text',
value: APP.instanceStatus.instanceName || ApiConfig.httpUnsafeOrigin || '',
value: getInstanceString('instanceName') || ApiConfig.httpUnsafeOrigin || '',
placeholder: ApiConfig.httpUnsafeOrigin,
style: 'margin-bottom: 5px;',
});
var $input = $(input);
var innerDiv = h('div.cp-admin-setname-form', input);
var innerDiv = h('div.cp-admin-setter', input);
var spinner = UI.makeSpinner($(innerDiv));
$button.click(function () {
@ -519,19 +568,19 @@ define([
return $div;
};
create['description'] = function () {
create['description'] = function () { // TODO support translation
var key = 'description';
var $div = makeBlock(key, true); // Msg.admin_descriptionHint
var textarea = h('textarea.cp-admin-description-text.cp-listing-info', {
var textarea = h('textarea.cp-admin-description-text', {
placeholder: Messages.home_host || '',
}, APP.instanceStatus.instanceDescription || '');
}, getInstanceString('instanceDescription'));
var $button = $div.find('button').text(Messages.settings_save);
$button.addClass('cp-listing-action');
var innerDiv = h('div.cp-admin-setdescription-form', [
var innerDiv = h('div.cp-admin-setter', [
textarea,
]);
$button.before(innerDiv);
@ -2290,20 +2339,6 @@ define([
if (!Array.isArray(data)) { return void cb('EINVAL'); }
APP.instanceStatus = data[0];
console.log("Status", APP.instanceStatus);
/*
var isListed = Boolean(APP.instanceStatus.listMyInstance);
var $actions = $('.cp-listing-action');
var $fields = $('.cp-listing-info');
if (isListed) {
$actions.removeAttr('disabled');
$fields.removeAttr('disabled');
} else {
$actions.attr('disabled', 'disabled');
$fields.attr('disabled', 'disabled');
}
*/
cb();
});
};

@ -2,6 +2,7 @@
@import (reference) '../../customize/src/less2/include/sidebar-layout.less';
@import (reference) '../../customize/src/less2/include/tools.less';
@import (reference) '../../customize/src/less2/include/avatar.less';
@import (reference) '../../customize/src/less2/include/variables.less';
&.cp-app-calendar {
@ -12,6 +13,7 @@
flex-flow: column;
.cp-toolbar-bottom-mid > div {
color: @cryptpad_text_col;
.cp-small { display: none; }
}
@ -117,6 +119,7 @@
.tui-full-calendar-popup-container {
background: @cp_flatpickr-bg;
color: @cryptpad_text_col;
border-radius: @variables_radius;
.tui-full-calendar-icon:not(.tui-full-calendar-calendar-dot):not(.tui-full-calendar-dropdown-arrow):not(.tui-full-calendar-ic-checkbox) {
display: none;
}
@ -182,6 +185,11 @@
.tui-full-calendar-section-allday {
width: 100%;
height: 32px;
border-radius: @variables_radius;
.tui-full-calendar-ic-checkbox {
margin-left: 5px;
border-radius: 2px;
}
}
}
}
@ -255,7 +263,8 @@
align-items: center;
margin-bottom: 20px;
input {
width: 100px;
width: 80px;
margin-right: 5px;
}
}
}
@ -273,6 +282,26 @@
#cp-toolbar .cp-calendar-browse {
display: flex;
align-items: center;
button {
color: @cp_toolbar-fg;
border-color: @cp_toolbar-fg;
&:hover {
background-color: fade(@cp_toolbar-fg, 50%); //XXX check light theme
cursor: pointer;
}
}
}
.cp-calendar-newevent {
&:hover {
cursor: pointer;
}
}
.cp-toolbar-bottom-right button, .cp-toolbar-user button {
&:hover {
cursor: pointer;
}
}
#cp-sidebarlayout-leftside {
@ -300,7 +329,7 @@
display: flex;
align-items: center;
justify-content: center;
margin: 5px 0;
margin: 5px 0 10px 0;
&:not(:first-child) {
margin-top: 30px;
}
@ -310,12 +339,20 @@
align-items: center;
justify-content: space-between;
padding: 5px;
border-radius: @variables_radius;
background-color: @cp_sidebar-left-bg;
&:not(.cp-unclickable) {
cursor: pointer;
}
.cp-dropdown-container {
position: initial;
}
button.cp-calendar-actions {
background-color: transparent;
&:hover {
background-color: @cp_sidebar-left-bg;
}
}
&.cp-ghost {
padding: 0;
button {
@ -326,12 +363,19 @@
justify-content: space-between;
background: transparent;
border: 1px solid @cryptpad_text_col;
border-radius: @variables_radius;
padding: 5px;
height: 36px;
font: @colortheme_app-font;
align-items: center;
color: @cryptpad_text_col;
&:hover {
background: @cp_sidebar-left-active;
background-color: @cp_sidebar-left-active;
color: @cp_sidebar-left-active-fg;
border: 0px;
}
i {
margin-left: 5px;
}
}
}
@ -339,21 +383,21 @@
margin-bottom: 10px;
}
&:hover {
background: fade(@cryptpad_text_col, 10%);
background: @cp_sidebar-left-item-bg;
}
&.cp-restricted {
color: @cp_drive-header-fg;
}
.cp-calendar-icon {
width: 36px;
width: 30px;
display: inline-flex;
height: 36px;
margin: -5px;
height: 30px;
align-items: center;
justify-content: center;
border-radius: @variables_radius;
}
&.cp-active {
background: @cp_sidebar-left-active;
background-color: @cp_sidebar-left-item-bg;
.cp-calendar-inactive {
display: none;
}

@ -616,7 +616,7 @@ define([
text: '',
options: options, // Entries displayed in the menu
common: common,
buttonCls: 'btn btn-cancel fa fa-ellipsis-h small'
buttonCls: 'btn btn-default fa fa-gear small cp-calendar-actions'
};
return UIElements.createDropdown(dropdownConfig)[0];
};

@ -2,6 +2,8 @@
@import (reference) "../../customize/src/less2/include/font.less";
@import (reference) "../../customize/src/less2/include/alertify.less";
@corner: 5px;
html, body {
.font_main();
.alertify_main();
@ -21,6 +23,7 @@ html, body {
.summary, .failure, .error, .success {
margin-bottom: 1em;
border-radius: @corner;
}
.pending {
@ -66,6 +69,7 @@ html, body {
word-break: break-word;
padding: 5px;
//font-size: 16px;
border-radius: @corner;
&.cp-danger {
border: 1px solid @cp_alerts-danger-bg;
background-color: @cp_alerts-danger-bg;

@ -12,6 +12,7 @@
var first = true;
window.addEventListener('error', function (ev) {
if (window.CHECKUP_MAIN_LOADED) { return; }
if (!ev) { return; }
var srcElement = ev.srcElement;
if (!srcElement) { return; }
@ -21,6 +22,8 @@
if (/\/api\/.*/.test(src)) {
console.error("A serverside API endpoint could not be reached.", src);
// don't warn about bower if the error is the optional instance endpoint
if (/\/api\/instance/.test(src)) { return; }
}
//if (!/\/bower_components\/.*/.test(src)) { return; }

@ -7,6 +7,6 @@
<body>
<div id="cp-progress"></div>
<iframe-placeholder>
<script type="text/javascript" src="/checkup/dependency-warning.js?ver=1.0.0"></script>
<script type="text/javascript" src="/checkup/dependency-warning.js?ver=1.0.1"></script>
<script data-bootload="main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>

@ -22,6 +22,8 @@ define([
], function ($, ApiConfig, Assertions, h, Messages, DomReady,
nThen, SFCommonO, Login, Hash, Util, Pinpad,
NetConfig, Pages, Tools, AppConfig) {
window.CHECKUP_MAIN_LOADED = true;
var Assert = Assertions();
var trimSlashes = function (s) {
if (typeof(s) !== 'string') { return s; }
@ -73,6 +75,7 @@ define([
var trimmedSafe = trimSlashes(ApiConfig.httpSafeOrigin);
var trimmedUnsafe = trimSlashes(ApiConfig.httpUnsafeOrigin);
var fileHost = ApiConfig.fileHost;
var accounts_api = ApiConfig.accounts_api || AppConfig.accounts_api || undefined;
var getAPIPlaceholderPath = function (relative) {
var absolute;
@ -984,7 +987,7 @@ define([
API_URL.origin,
isHTTPS(fileHost)? fileHost: undefined,
// support for cryptpad.fr configuration
AppConfig.accounts_api,
accounts_api,
![trimmedUnsafe, trimmedSafe].includes(ACCOUNTS_URL)? ACCOUNTS_URL: undefined,
],
@ -1023,7 +1026,7 @@ define([
$sandbox,
API_URL.origin,
isHTTPS(fileHost)? fileHost: undefined,
AppConfig.accounts_api,
accounts_api,
![trimmedUnsafe, trimmedSafe].includes(ACCOUNTS_URL)? ACCOUNTS_URL: undefined,
],
'img-src': ["'self'", 'data:', 'blob:', $outer],
@ -1364,6 +1367,55 @@ define([
});
});
assert(function (cb, msg) {
var url = '/api/instance';
msg.appendChild(h('span', [
link(url, url),
" did not load as expected. This is most likely caused by a missing directive in your reverse proxy or an outdated version of the API server.",
]));
require([
`optional!${url}`,
], function (Instance) {
// if the URL fails to load then an empty object will be returned
// this can be interpreted as a failure, even though the rest of the platform should still work
if (!Object.keys(Instance).length) {
return void cb(Instance);
}
cb(true);
});
});
assert(function (cb, msg) {
if (!ApiConfig.listMyInstance) { return void cb(true); }
msg.appendChild(h('span', [
"The administrators of this instance have opted in to inclusion in ",
link('https://cryptpad.org/instances/', 'the public instance directory'),
' but have not configured at least one of the expected ',
code('description'),
' or ',
code('location'),
' text fields via the instance admin panel.',
]));
var expected = [
'description',
'location',
//'name',
// 'notice',
];
var url = '/api/instance';
require([
`optional!${url}`,
], function (Instance) {
var good = expected.every(function (k) {
var val = Instance[k];
return (val && typeof(val) === 'object' && typeof(val.default) === 'string' && val.default.trim());
});
return void cb(good || Instance);
});
});
var serverToken;
Tools.common_xhr('/', function (xhr) {
serverToken = xhr.getResponseHeader('server');

@ -56,7 +56,7 @@
}
}
#cp-app-code-preview {
padding: 5px 20px;
padding: 5px 10px;
overflow: auto;
display: inline-block;
height: 100%;
@ -101,7 +101,7 @@
#cp-app-code-preview-content {
background-color: @cp_preview-bg;
color: @cp_preview-fg;
max-width: 40vw;
max-width: 70ch;
margin: 1em auto;
.markdown_preformatted-code;

@ -235,6 +235,7 @@ define([
$codeMirrorContainer.removeClass('cp-app-code-fullpage');
if (isPresentMode) {
$editorContainer.addClass('cp-app-code-present');
$previewButton.hide();
}
}
});

@ -96,7 +96,7 @@ define(function() {
*
* See the comments above for a description of possible configurations.
*/
AppConfig.terms = true;
AppConfig.terms = false;
/* The terms of CryptPad's license require that its source code be made available
* to anyone who uses the software. If you have not made any modifications to the platform
@ -194,12 +194,18 @@ define(function() {
whiteboard: 'cptools-whiteboard',
todo: 'cptools-todo',
contacts: 'fa-address-book',
calendar: 'fa-calendar',
kanban: 'cptools-kanban',
doc: 'fa-file-word-o',
presentation: 'fa-file-powerpoint-o',
sheet: 'fa-file-excel-o',
drive: 'fa-hdd-o',
teams: 'fa-users',
admin: 'fa-gears',
settings: 'fa-gear',
profile: 'fa-user-circle',
support: 'fa-life-ring',
accounts: 'fa-ticket'
};
// Ability to create owned pads and expiring pads through a new pad creation screen.

@ -1731,6 +1731,14 @@ define([
var padType = metadataMgr.getMetadata().type;
var options = [];
options.push({
tag: 'div',
attributes: {'class': 'cp-user-menu-logo'},
content: h('span', [
h('img', {src: '/customize/CryptPad_logo_grey.svg',alt: 'CryptPad logo',}), // XXX hardcoded alt text?
h('span.cp-user-menu-logo-text', "CryptPad")
]),
});
if (config.displayNameCls) {
var userAdminContent = [];
if (accountName) {
@ -2014,6 +2022,15 @@ define([
// If no display name, do not display the parentheses
$userbig.append($('<span>', {'class': 'account-name'}).text(accountName));
}*/
options.forEach(function (option) {
var f = option.action;
if (!f) { return; }
option.action = function () {
f();
return true;
};
});
var dropdownConfigUser = {
buttonContent: $userButton[0],
options: options, // Entries displayed in the menu

@ -626,6 +626,7 @@ define([
// UI containers
var $tree = APP.$tree = $("#cp-app-drive-tree");
var $content = APP.$content = $("#cp-app-drive-content");
var $contentContainer = APP.$content = $("#cp-app-drive-content-container");
var $appContainer = $(".cp-app-drive-container");
var $driveToolbar = APP.toolbar.$bottom;
var $contextMenu = createContextMenu(common).appendTo($appContainer);
@ -635,6 +636,26 @@ define([
var $trashTreeContextMenu = $("#cp-app-drive-context-trashtree");
var $trashContextMenu = $("#cp-app-drive-context-trash");
var splitter = h('div.cp-splitter', [
h('i.fa.fa-ellipsis-v')
]);
$contentContainer.append(splitter);
APP.$splitter = $(splitter).on('mousedown', function (e) {
e.preventDefault();
var x = e.pageX;
var w = $tree.width();
var handler = function (evt) {
if (evt.type === 'mouseup') {
$(window).off('mouseup mousemove', handler);
return;
}
$tree.css('width', (w - x + evt.pageX) + 'px');
};
$(window).off('mouseup mousemove', handler);
$(window).on('mouseup mousemove', handler);
});
// TOOLBAR
// DRIVE
@ -3391,6 +3412,7 @@ define([
APP.toolbar.$bottomL.append(APP.$collapseButton);
APP.$collapseButton.off('click').on('click', function () {
APP.$tree.toggle();
APP.$splitter.toggle(APP.$tree.is(':visible'));
checkCollapseButton();
});
};

@ -149,6 +149,7 @@ var factory = function () {
justify-content: center;
box-sizing: border-box;
vertical-align: top;
border-radius: 5px;
}
.mediatag-progress-bar {
position: absolute;

@ -1,5 +1,5 @@
/*
* Copyright (C) Ascensio System SIA 2012-2021. All rights reserved
* Copyright (C) Ascensio System SIA 2012-2022. All rights reserved
*
* https://www.onlyoffice.com/
*
@ -1812,7 +1812,7 @@ function(){this.isPreOpenLocks=false;for(var i=0;i<this.arrPreOpenLocksObjects.l
function(){if(!this.SpellCheckApi)return;this.SpellCheckApi.disconnect();this.isSpellCheckEnable=false;this._spellCheckDisconnect()};baseEditorsApi.prototype._spellCheckRestart=function(word){};baseEditorsApi.prototype._spellCheckDisconnect=function(){};baseEditorsApi.prototype._coSpellCheckInit=function(){var t=this;if(!this.SpellCheckApi)return;if(window["AscDesktopEditor"]){window["asc_nativeOnSpellCheck"]=function(response){var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;
if(_editor.SpellCheckApi){if("clear"===response){_editor.SpellCheckApi.isRestart=false;return}if(_editor.SpellCheckApi.isRestart===true)return;_editor.SpellCheckApi.onSpellCheck(response)}};this.SpellCheckApi.spellCheck=function(spellData){window["AscDesktopEditor"]["SpellCheck"](JSON.stringify(spellData))};this.SpellCheckApi.disconnect=function(){};this.SpellCheckApi.restart=function(){this.isRestart=true;window["AscDesktopEditor"]["SpellCheck"]("clear")};if(window["AscDesktopEditor"]["IsLocalFile"]&&
!window["AscDesktopEditor"]["IsLocalFile"]())this.sendEvent("asc_onSpellCheckInit",["1026","1027","1029","1030","1031","1032","1033","1036","1038","1040","1042","1043","1044","1045","1046","1048","1049","1050","1051","1053","1055","1057","1058","1060","1062","1063","1066","1068","1069","1087","1104","1110","1134","2051","2055","2057","2068","2070","3079","3081","3082","4105","7177","9242","10266","2067"])}else{if(!this.SpellCheckUrl&&!window["NATIVE_EDITOR_ENJINE"]){this.SpellCheckApi={};this.SpellCheckApi.log=
false;this.SpellCheckApi.worker=new CSpellchecker({api:this,enginePath:"../../../../sdkjs/common/spell/spell",dictionariesPath:"./../../../../dictionaries"});this.SpellCheckApi.checkDictionary=function(lang){if(this.log)console.log("checkDictionary: "+lang+": "+this.worker.checkDictionary(lang));return this.worker.checkDictionary(lang)};this.SpellCheckApi.spellCheck=function(spellData){if(this.log){console.log("spellCheck:");console.log(spellData)}this.worker.command(spellData)};this.SpellCheckApi.worker.oncommand=
false;this.SpellCheckApi.worker=new CSpellchecker({api:this,enginePath:"../../../../sdkjs/common/spell/spell",dictionariesPath:"./../../../../dictionaries"});this.SpellCheckApi.checkDictionary=function(lang){if(this.log)console.log("checkDictionary: "+lang+": "+this.worker.checkDictionary(lang));return this.worker.checkDictionary(lang)};this.SpellCheckApi.spellCheck=function(spellData){return;if(this.log){console.log("spellCheck:");console.log(spellData)}this.worker.command(spellData)};this.SpellCheckApi.worker.oncommand=
function(spellData){if(t.SpellCheckApi.log){console.log("onSpellCheck:");console.log(spellData)}t.SpellCheck_CallBack(spellData)};this.SpellCheckApi.disconnect=function(){};this.SpellCheckApi.restart=function(){this.worker.restart()};this.sendEvent("asc_onSpellCheckInit",this.SpellCheckApi.worker.getLanguages());return}if(this.SpellCheckUrl&&this.isSpellCheckEnable)this.SpellCheckApi.set_url(this.SpellCheckUrl)}this.SpellCheckApi.onInit=function(e){t.sendEvent("asc_onSpellCheckInit",e)};this.SpellCheckApi.onSpellCheck=
function(e){t.SpellCheck_CallBack(e)};this.SpellCheckApi.init(this.documentId)};baseEditorsApi.prototype.asc_spellCheckAddToDictionary=function(SpellCheckProperty){var word=typeof SpellCheckProperty==="string"?SpellCheckProperty:SpellCheckProperty.Word;if(window["AscDesktopEditor"]){window["AscDesktopEditor"]["SpellCheck"]('{"type":"add","usrWords":["'+word+'"]}');this._spellCheckRestart(word)}};baseEditorsApi.prototype.asc_spellCheckClearDictionary=function(){};baseEditorsApi.prototype.asc_restartCheckSpelling=
function(){};baseEditorsApi.prototype._waitPrint=function(actionType,options){return false};baseEditorsApi.prototype._printDesktop=function(){};baseEditorsApi.prototype.endInsertDocumentUrls=function(){};baseEditorsApi.prototype._downloadAs=function(){};baseEditorsApi.prototype.downloadAs=function(actionType,options){var isCloudCrypto=!!(window["AscDesktopEditor"]&&0<window["AscDesktopEditor"]["CryptoMode"]);if(isCloudCrypto)window.isCloudCryptoDownloadAs=true;if(this._waitPrint(actionType,options))return;
@ -2363,6 +2363,6 @@ prot.asc_beforeInsertSlicer;prot["asc_insertSlicer"]=prot.asc_insertSlicer;prot[
function CSpellchecker(settings){this.api=settings.api;this.useWasm=false;var webAsmObj=window["WebAssembly"];if(typeof webAsmObj==="object")if(typeof webAsmObj["Memory"]==="function")if(typeof webAsmObj["instantiateStreaming"]==="function"||typeof webAsmObj["instantiate"]==="function")this.useWasm=true;this.enginePath="./spell/";if(settings&&settings.enginePath){this.enginePath=settings.enginePath;if(this.enginePath.substring(this.enginePath.length-1)!="/")this.enginePath+="/"}var dictionariesPath=
"./../dictionaries";if(settings&&settings.dictionariesPath){dictionariesPath=settings.dictionariesPath;if(dictionariesPath.substring(dictionariesPath.length-1)=="/")dictionariesPath=dictionariesPath.substr(0,dictionariesPath.length-1)}this.isUseSharedWorker=!!window.SharedWorker;if(this.isUseSharedWorker&&false===settings.useShared)this.isUseSharedWorker=false;this.worker=null;this.languages={1068:"az_Latn_AZ",1026:"bg_BG",1027:"ca_ES",2051:"ca_ES_valencia",1029:"cs_CZ",1030:"da_DK",3079:"de_AT",
2055:"de_CH",1031:"de_DE",1032:"el_GR",3081:"en_AU",4105:"en_CA",2057:"en_GB",1033:"en_US",7177:"en_ZA",3082:"es_ES",1069:"eu_ES",1036:"fr_FR",1110:"gl_ES",1050:"hr_HR",1038:"hu_HU",1057:"id_ID",1040:"it_IT",1087:"kk_KZ",1042:"ko_KR",1134:"lb_LU",1063:"lt_LT",1062:"lv_LV",1104:"mn_MN",1044:"nb_NO",1043:"nl_NL",2068:"nn_NO",1045:"pl_PL",1046:"pt_BR",2070:"pt_PT",1048:"ro_RO",1049:"ru_RU",1051:"sk_SK",1060:"sl_SI",10266:"sr_Cyrl_RS",9242:"sr_Latn_RS",1053:"sv_SE",1055:"tr_TR",1058:"uk_UA",1066:"vi_VN",
2067:"nl_NL"};this.stop=function(){if(!this.worker)return;try{if(this.worker.port)this.worker.port.close();else if(this.worker.terminate)this.worker.terminate()}catch(err){}this.worker=null};this.restart=function(){this.stop();var worker_src=this.useWasm?"spell.js":"spell_ie.js";worker_src=this.enginePath+worker_src;if(this.isUseSharedWorker){this.worker=new SharedWorker(worker_src,"onlyoffice-spellchecker");this.worker.creator=this;this.worker.onerror=function(){var creator=this.creator;creator.worker=
2067:"nl_NL"};this.stop=function(){if(!this.worker)return;try{if(this.worker.port)this.worker.port.close();else if(this.worker.terminate)this.worker.terminate()}catch(err){}this.worker=null};this.restart=function(){return;this.stop();var worker_src=this.useWasm?"spell.js":"spell_ie.js";worker_src=this.enginePath+worker_src;if(this.isUseSharedWorker){this.worker=new SharedWorker(worker_src,"onlyoffice-spellchecker");this.worker.creator=this;this.worker.onerror=function(){var creator=this.creator;creator.worker=
new Worker(worker_src);creator._start(creator.worker)};this._start(this.worker.port)}else{this.worker=new Worker(worker_src);var _t=this;this.worker.onerror=function(e){AscCommon.stopEvent(e);if(_t.useWasm){_t.useWasm=false;_t.restart();_t.api.asc_restartCheckSpelling()}};this._start(this.worker)}};this.oncommand=function(message){console.log(message)};this.checkDictionary=function(lang){return undefined!==this.languages[""+lang]?true:false};this.getLanguages=function(){var ret=[];for(var lang in this.languages)ret.push(lang);
return ret};this._start=function(_port){var _worker=this;_port.onmessage=function(message){_worker.oncommand&&_worker.oncommand(message.data)};_port.postMessage({"type":"init","dictionaries_path":dictionariesPath,"languages":this.languages});this.command=function(message){_port&&_port.postMessage(message)}};this.restart()}

@ -1,5 +1,5 @@
/*
* Copyright (C) Ascensio System SIA 2012-2021. All rights reserved
* Copyright (C) Ascensio System SIA 2012-2022. All rights reserved
*
* https://www.onlyoffice.com/
*
@ -19303,8 +19303,8 @@ if(!oRun.m_oContentChanges)return;for(var Index=0,Count=this.Items.length;Index<
AscCommon.CollaborativeEditing.Update_DocumentPositionsOnAdd(oRun,Pos);if(Element.SetParent)Element.SetParent(oRun)}}oRun.RecalcInfo.Measure=true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false);oRun.private_UpdateDocumentOutline()};CChangesRunAddItem.prototype.IsRelated=function(oChanges){if(this.Class===oChanges.Class&&(AscDFH.historyitem_ParaRun_AddItem===oChanges.Type||AscDFH.historyitem_ParaRun_RemoveItem===oChanges.Type))return true;return false};CChangesRunAddItem.prototype.CreateReverseChange=
function(){return this.private_CreateReverseChange(CChangesRunRemoveItem)};function CChangesRunRemoveItem(Class,Pos,Items){AscDFH.CChangesBaseContentChange.call(this,Class,Pos,Items,false)}CChangesRunRemoveItem.prototype=Object.create(AscDFH.CChangesBaseContentChange.prototype);CChangesRunRemoveItem.prototype.constructor=CChangesRunRemoveItem;CChangesRunRemoveItem.prototype.Type=AscDFH.historyitem_ParaRun_RemoveItem;CChangesRunRemoveItem.prototype.Undo=function(){var oRun=this.Class;var Array_start=
oRun.Content.slice(0,this.Pos);var Array_end=oRun.Content.slice(this.Pos);oRun.Content=Array_start.concat(this.Items,Array_end);oRun.RecalcInfo.Measure=true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false);for(var nIndex=0,nCount=this.Items.length;nIndex<nCount;++nIndex)if(this.Items[nIndex].SetParent)this.Items[nIndex].SetParent(oRun)};CChangesRunRemoveItem.prototype.Redo=function(){var oRun=this.Class;oRun.Content.splice(this.Pos,this.Items.length);oRun.RecalcInfo.Measure=
true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false)};CChangesRunRemoveItem.prototype.private_WriteItem=function(Writer,Item){Item.Write_ToBinary(Writer)};CChangesRunRemoveItem.prototype.private_ReadItem=function(Reader){return ParagraphContent_Read_FromBinary(Reader)};CChangesRunRemoveItem.prototype.Load=function(){var oRun=this.Class;var nLastChangesPos=null;var nChangesCount=0;for(var Index=0,Count=this.PosArray.length;Index<Count;Index++){var nChangesPos=
oRun.m_oContentChanges.Check(AscCommon.contentchanges_Remove,this.PosArray[Index]);if(false===nChangesPos)continue;if(null===nLastChangesPos){nLastChangesPos=nChangesPos;nChangesCount=1}else if(nLastChangesPos===nChangesPos)nChangesCount++;else{oRun.CollaborativeMarks.Update_OnRemove(nLastChangesPos,nChangesCount);oRun.Content.splice(nLastChangesPos,nChangesCount);oRun.private_UpdatePositionsOnRemove(nLastChangesPos,nChangesCount);oRun.private_UpdateCompositeInputPositionsOnRemove(nLastChangesPos,
true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false)};CChangesRunRemoveItem.prototype.private_WriteItem=function(Writer,Item){Item.Write_ToBinary(Writer)};CChangesRunRemoveItem.prototype.private_ReadItem=function(Reader){return ParagraphContent_Read_FromBinary(Reader)};CChangesRunRemoveItem.prototype.Load=function(){var oRun=this.Class;if(!oRun.m_oContentChanges)return;var nLastChangesPos=null;var nChangesCount=0;for(var Index=0,Count=this.PosArray.length;Index<
Count;Index++){var nChangesPos=oRun.m_oContentChanges.Check(AscCommon.contentchanges_Remove,this.PosArray[Index]);if(false===nChangesPos)continue;if(null===nLastChangesPos){nLastChangesPos=nChangesPos;nChangesCount=1}else if(nLastChangesPos===nChangesPos)nChangesCount++;else{oRun.CollaborativeMarks.Update_OnRemove(nLastChangesPos,nChangesCount);oRun.Content.splice(nLastChangesPos,nChangesCount);oRun.private_UpdatePositionsOnRemove(nLastChangesPos,nChangesCount);oRun.private_UpdateCompositeInputPositionsOnRemove(nLastChangesPos,
nChangesCount);AscCommon.CollaborativeEditing.Update_DocumentPositionsOnRemove(oRun,nLastChangesPos,nChangesCount);nLastChangesPos=nChangesPos;nChangesCount=1}}if(nChangesCount){oRun.CollaborativeMarks.Update_OnRemove(nLastChangesPos,nChangesCount);oRun.Content.splice(nLastChangesPos,nChangesCount);oRun.private_UpdatePositionsOnRemove(nLastChangesPos,nChangesCount);oRun.private_UpdateCompositeInputPositionsOnRemove(nLastChangesPos,nChangesCount);AscCommon.CollaborativeEditing.Update_DocumentPositionsOnRemove(oRun,
nLastChangesPos,nChangesCount)}oRun.RecalcInfo.Measure=true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false);oRun.private_UpdateDocumentOutline()};CChangesRunRemoveItem.prototype.IsRelated=function(oChanges){if(this.Class===oChanges.Class&&(AscDFH.historyitem_ParaRun_AddItem===oChanges.Type||AscDFH.historyitem_ParaRun_RemoveItem===oChanges.Type))return true;return false};CChangesRunRemoveItem.prototype.CreateReverseChange=function(){return this.private_CreateReverseChange(CChangesRunAddItem)};
function CChangesRunBold(Class,Old,New,Color){AscDFH.CChangesBaseBoolProperty.call(this,Class,Old,New,Color)}CChangesRunBold.prototype=Object.create(AscDFH.CChangesBaseBoolProperty.prototype);CChangesRunBold.prototype.constructor=CChangesRunBold;CChangesRunBold.prototype.Type=AscDFH.historyitem_ParaRun_Bold;CChangesRunBold.prototype.private_SetValue=function(Value){var oRun=this.Class;oRun.Pr.Bold=Value;oRun.Recalc_CompiledPr(true);oRun.private_UpdateTrackRevisionOnChangeTextPr(false)};CChangesRunBold.prototype.Load=
@ -27529,81 +27529,81 @@ false;this.CopyFlag=false;this.Api=null;this.IsNeedDivOnCopy=AscBrowser.isIE;thi
else{this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal);setTimeout(function(){g_clipboardBase.CommonDiv_End()},0);e.preventDefault();return false}},_private_oncut:function(e){this._console_log("oncut");if(!this.Api.asc_IsFocus(true))return;this.bCut=true;this.ClosureParams._e=e;if(this.IsNeedDivOnCopy)this.CommonDiv_Copy();else{this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|
AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal)}this.Api.asc_SelectionCut();this.bCut=false;if(!this.IsNeedDivOnCopy){setTimeout(function(){g_clipboardBase.CommonDiv_End()},0);e.preventDefault();return false}},_private_onpaste:function(e){this._console_log("onpaste");if(!this.Api.asc_IsFocus(true))return;if(!this.IsNeedDivOnPaste)e.preventDefault();this.ClosureParams._e=e;if(this.Api.isLongAction())return false;this.PasteFlag=true;this.Api.incrementCounterLongAction();
this.pastedFrom=null;if(this.IsNeedDivOnPaste){window.setTimeout(function(){g_clipboardBase.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.HtmlElement,g_clipboardBase.CommonDiv);g_clipboardBase.CommonDiv_End();g_clipboardBase.Paste_End()},0);return}else{var _clipboard=e&&e.clipboardData?e.clipboardData:window.clipboardData;if(!_clipboard||!_clipboard.getData)return false;var _text_format=this.ClosureParams.getData("text/plain");var _internal=this.ClosureParams.getData("text/x-custom");if(_internal&&
_internal!=""&&_internal.indexOf("asc_internalData2;")==0){this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Internal,_internal.substr("asc_internalData2;".length),null,_text_format);g_clipboardBase.Paste_End();return false}var _html_format=this.ClosureParams.getData("text/html");if(_html_format&&_html_format!=""){var nIndex=_html_format.indexOf("</html>");if(-1!=nIndex)_html_format=_html_format.substring(0,nIndex+"</html>".length);this.CommonIframe_PasteStart(_html_format,_text_format);
return false}if(_text_format&&_text_format!=""){this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Text,_text_format);g_clipboardBase.Paste_End();return false}var items=_clipboard.items;if(null!=items&&0!=items.length){g_clipboardBase.PasteImagesBody="";g_clipboardBase.PasteImagesCount=items.length;g_clipboardBase.PasteImagesCounter=0;for(var i=0;i<items.length;++i)if(items[i].kind=="file"&&items[i].type.indexOf("image/")!==-1){var blob=items[i].getAsFile();var reader=new FileReader;reader.onload=
function(e){g_clipboardBase.PasteImagesCounter++;g_clipboardBase.PasteImagesBody+='<img src="'+e.target.result+'"/>';if(g_clipboardBase.PasteImagesCounter==g_clipboardBase.PasteImagesCount){g_clipboardBase.CommonIframe_PasteStart("<html><body>"+g_clipboardBase.PasteImagesBody+"</body></html>");g_clipboardBase.PasteImagesBody="";g_clipboardBase.PasteImagesCounter=0;g_clipboardBase.PasteImagesCount=0}};reader.onabort=reader.onerror=function(e){g_clipboardBase.PasteImagesCounter++;if(g_clipboardBase.PasteImagesCounter==
g_clipboardBase.PasteImagesCount){g_clipboardBase.CommonIframe_PasteStart("<html><body>"+g_clipboardBase.PasteImagesBody+"</body></html>");g_clipboardBase.PasteImagesBody="";g_clipboardBase.PasteImagesCounter=0;g_clipboardBase.PasteImagesCount=0}};try{reader.readAsDataURL(blob)}catch(err){g_clipboardBase.PasteImagesCounter++}}else g_clipboardBase.PasteImagesCounter++;if(g_clipboardBase.PasteImagesCounter==g_clipboardBase.PasteImagesCount)g_clipboardBase.Paste_End();return false}}g_clipboardBase.Paste_End();
return false},_private_onbeforepaste:function(e,isAttackEmulate){this._console_log("onbeforepaste");if(!this.Api.asc_IsFocus(true))return;{this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.CommonDiv.focus();this.StartFocus();this.CommonDiv_Select();return}return false},_private_onbeforecopy_select:function(){if(AscBrowser.isIE){this._console_log("onbeforecopy_select");this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.CommonDiv.innerHTML="<span> </span>";this.CommonDiv.focus();
this.StartFocus();this.CommonDiv_Select()}},_private_onbeforecopy:function(e,isAttackEmulate){this._console_log("onbeforecopy");if(!this.Api.asc_IsFocus(true))return;{this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.CommonDiv.innerHTML="<span> </span>";this.CommonDiv.focus();this.StartFocus();this.CommonDiv_Select()}return false},Init:function(_api){this.Api=_api;window["AscCommon"].g_specialPasteHelper.Init(_api);this.ClosureParams.getData=function(type){var _clipboard=this._e&&
this._e.clipboardData?this._e.clipboardData:window.clipboardData;if(!_clipboard||!_clipboard.getData)return null;var _type=type;if(AscBrowser.isIE&&(type=="text"||type=="text/plain"))_type="Text";try{return _clipboard.getData(_type)}catch(e){}return null};this.ClosureParams.setData=function(type,_data){var _clipboard=this._e&&this._e.clipboardData?this._e.clipboardData:window.clipboardData;if(!_clipboard||!_clipboard.setData)return null;var _type=type;if(AscBrowser.isIE&&(type=="text"||type=="text/plain"))_type=
"Text";try{_clipboard.setData(_type,_data)}catch(e){}};if(!AscBrowser.isIE){document.oncopy=function(e){return g_clipboardBase._private_oncopy(e)};document.oncut=function(e){return g_clipboardBase._private_oncut(e)};document.onpaste=function(e){return g_clipboardBase._private_onpaste(e)};document["onbeforecopy"]=function(e){return g_clipboardBase._private_onbeforecopy(e)};document["onbeforecut"]=function(e){return g_clipboardBase._private_onbeforecopy(e)};document["onbeforepaste"]=function(e){return g_clipboardBase._private_onbeforepaste(e)}}else{document.addEventListener("copy",
function(e){return g_clipboardBase._private_oncopy(e)});document.addEventListener("cut",function(e){return g_clipboardBase._private_oncut(e)});document.addEventListener("paste",function(e){return g_clipboardBase._private_onpaste(e)});document.addEventListener("beforepaste",function(e){return g_clipboardBase._private_onbeforepaste(e)});document.addEventListener("beforecopy",function(e){return g_clipboardBase._private_onbeforecopy(e)});document.addEventListener("beforecut",function(e){return g_clipboardBase._private_onbeforecopy(e)})}if(this.IsCopyCutOnlyInEditable||
this.IsPasteOnlyInEditable)document.onkeydown=function(e){if(!g_clipboardBase.Api.asc_IsFocus(true)||g_clipboardBase.Api.isLongAction())return;var isAltGr=AscCommon.getAltGr(e);if(isAltGr)return;var isCtrl=e.ctrlKey===true||e.metaKey===true;var isShift=e.shiftKey;var keyCode=e.keyCode;if(g_clipboardBase.IsCopyCutOnlyInEditable){var bIsBeforeCopyCutEmulate=false;var _cut=false;if(isCtrl&&!isShift&&(keyCode==67||keyCode==88))bIsBeforeCopyCutEmulate=true;if(!isCtrl&&isShift&&keyCode==45){bIsBeforeCopyCutEmulate=
true;_cut=true}if(bIsBeforeCopyCutEmulate){g_clipboardBase._console_log("emulate_beforecopycut");var isEmulate=false;try{isEmulate=_cut?document.execCommand("beforecut"):document.execCommand("beforecopy")}catch(err){}g_clipboardBase._private_onbeforecopy(undefined,!isEmulate)}}if(g_clipboardBase.IsPasteOnlyInEditable){var bIsBeforePasteEmulate=false;if(isCtrl&&!isShift&&keyCode==86)bIsBeforePasteEmulate=true;if(!isCtrl&&isShift&&keyCode==45)bIsBeforePasteEmulate=true;if(bIsBeforePasteEmulate){g_clipboardBase._console_log("emulate_beforepaste");
var isEmulate=false;try{isEmulate=document.execCommand("beforepaste")}catch(err$14){}g_clipboardBase._private_onbeforepaste(undefined,!isEmulate)}}};if(AscBrowser.isSafari&&false){this.CommonDiv=this.CommonDiv_Check();setInterval(function(){if(g_clipboardBase.Api.asc_IsFocus(true))g_clipboardBase.CommonDiv.focus()},100)}},IsWorking:function(){return this.CopyFlag||this.PasteFlag?true:false},StartFocus:function(){this.EndFocus(false);this.CopyPasteFocus=true;this.CopyPasteFocusTimer=setTimeout(function(){g_clipboardBase.EndFocus()},
1E3)},EndFocus:function(isFocusToEditor){this.CopyPasteFocus=false;if(-1!=this.CopyPasteFocusTimer){clearTimeout(this.CopyPasteFocusTimer);this.CopyPasteFocusTimer=-1;if(false!==isFocusToEditor&&null!=this.inputContext)if(this.inputContext.HtmlArea)this.inputContext.HtmlArea.focus()}},IsFocus:function(){return this.CopyPasteFocus},CommonDiv_Check:function(){var ElemToSelect=document.getElementById(this.CommonDivId);if(!ElemToSelect){ElemToSelect=document.createElement("div");ElemToSelect.id=this.CommonDivId;
ElemToSelect.className=this.CommonDivClassName;ElemToSelect.style.position="fixed";ElemToSelect.style.left="0px";ElemToSelect.style.top="-100px";ElemToSelect.style.width="10000px";ElemToSelect.style.height="100px";ElemToSelect.style.overflow="hidden";ElemToSelect.style.zIndex=-1E3;ElemToSelect.style.MozUserSelect="text";ElemToSelect.style.fontFamily="onlyofficeDefaultFont";ElemToSelect.style.fontSize="11pt";ElemToSelect.style.color="black";ElemToSelect.style["-khtml-user-select"]="text";ElemToSelect.style["-o-user-select"]=
"text";ElemToSelect.style["user-select"]="text";ElemToSelect.style["-webkit-user-select"]="text";ElemToSelect.setAttribute("contentEditable",this.isCopyOutEnabled());var _parent=""==this.CommonDivIdParent?document.body:document.getElementById(this.CommonDivIdParent);_parent.appendChild(ElemToSelect)}else ElemToSelect.setAttribute("contentEditable",this.isCopyOutEnabled());return ElemToSelect},CommonDiv_Select:function(){var ElemToSelect=this.CommonDiv;if(window.getSelection){var selection=window.getSelection();
var rangeToSelect=document.createRange();var is_gecko=AscBrowser.isGecko;if(is_gecko){ElemToSelect.appendChild(document.createTextNode("\u00a0"));ElemToSelect.insertBefore(document.createTextNode("\u00a0"),ElemToSelect.firstChild);rangeToSelect.setStartAfter(ElemToSelect.firstChild);rangeToSelect.setEndBefore(ElemToSelect.lastChild)}else{var aChildNodes=ElemToSelect.childNodes;if(aChildNodes.length==1){var elem=aChildNodes[0];var wrap=document.createElement("b");wrap.setAttribute("style","font-weight:normal; background-color: transparent; color: transparent;");
elem=ElemToSelect.removeChild(elem);wrap.appendChild(elem);ElemToSelect.appendChild(wrap)}rangeToSelect.selectNodeContents(ElemToSelect)}selection.removeAllRanges();selection.addRange(rangeToSelect)}else if(document.body.createTextRange){var rangeToSelect=document.body.createTextRange();rangeToSelect.moveToElementText(ElemToSelect);rangeToSelect.select()}},CommonDiv_Start:function(){this.ClosureParams.overflowBody=document.body.style.overflow;document.body.style.overflow="hidden";this.ClosureParams.backgroundcolorBody=
document.body.style["background-color"];document.body.style["background-color"]="transparent";var ElemToSelect=this.CommonDiv;ElemToSelect.style.display="block";while(ElemToSelect.hasChildNodes())ElemToSelect.removeChild(ElemToSelect.lastChild);document.body.style.MozUserSelect="text";delete document.body.style["-khtml-user-select"];delete document.body.style["-o-user-select"];delete document.body.style["user-select"];document.body.style["-webkit-user-select"]="text";ElemToSelect.style.MozUserSelect=
"all"},CommonDiv_End:function(){var ElemToSelect=this.CommonDiv;if(ElemToSelect){ElemToSelect.style.display=AscBrowser.isSafari?"block":"none";ElemToSelect.style.MozUserSelect="none"}document.body.style.MozUserSelect="none";document.body.style["-khtml-user-select"]="none";document.body.style["-o-user-select"]="none";document.body.style["user-select"]="none";document.body.style["-webkit-user-select"]="none";document.body.style["background-color"]=this.ClosureParams.backgroundcolorBody;document.body.style.overflow=
this.ClosureParams.overflowBody;this.CopyFlag=false;this.bCut=false;this.EndFocus()},CommonDiv_Copy:function(){this.CopyFlag=true;this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.ClosureParams.isDivCopy=true;this.DivOnCopyHtmlPresent=false;this.DivOnCopyText="";this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal);this.ClosureParams.isDivCopy=false;if(!this.DivOnCopyHtmlPresent&&
this.DivOnCopyText!="")this.CommonDiv.innerHTML=this.DivOnCopyText;this.DivOnCopyHtmlPresent=false;this.DivOnCopyText="";this.CommonDiv_Select();window.setTimeout(function(){g_clipboardBase.CommonDiv_End()},0)},CommonDiv_Execute_CopyCut:function(){if(this.IsCopyCutOnlyInEditable)this._private_onbeforecopy(undefined,true)},CommonIframe_PasteStart:function(_html_data,text_data){var ifr=document.getElementById(this.CommonIframeId);if(!ifr){ifr=document.createElement("iframe");ifr.name=this.CommonIframeId;
ifr.id=this.CommonIframeId;ifr.style.position="absolute";ifr.style.top="-100px";ifr.style.left="0px";ifr.style.width="10000px";ifr.style.height="100px";ifr.style.overflow="hidden";ifr.style.zIndex=-1E3;ifr.setAttribute("sandbox","allow-same-origin");document.body.appendChild(ifr);this.CommonIframe=ifr}else ifr.style.width="10000px";var frameWindow=window.frames[this.CommonIframeId];if(frameWindow){frameWindow.document.open();frameWindow.document.write(_html_data);frameWindow.document.close();if(null!=
frameWindow.document&&null!=frameWindow.document.body){ifr.style.display="block";this.pastedFrom=definePastedFrom(frameWindow.document);this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.HtmlElement,frameWindow.document.body,ifr,text_data)}}ifr.style.width="100px";g_clipboardBase.Paste_End()},CommonIframe_PasteEnd:function(){if(this.CommonIframe&&this.CommonIframe.style.display!="none"){this.CommonIframe.blur();this.CommonIframe.style.display="none"}},Paste_End:function(){this.CommonIframe_PasteEnd();
this.Api.decrementCounterLongAction();this.PasteFlag=false;this.EndFocus();if(this.needClearBuffer){this.ClearBuffer();this.needClearBuffer=false}},pushData:function(_format,_data){if(null==this.LastCopyBinary)this.LastCopyBinary=[];this.LastCopyBinary.push({type:_format,data:_data});if(this.ClosureParams.isDivCopy===true){if(!this.isCopyOutEnabled())return;if(_format==AscCommon.c_oAscClipboardDataFormat.Html){this.CommonDiv.innerHTML=_data;this.DivOnCopyHtmlPresent=true}if(_format==AscCommon.c_oAscClipboardDataFormat.Text)this.DivOnCopyText=
_data;return}var _data_format="";switch(_format){case AscCommon.c_oAscClipboardDataFormat.Html:_data_format="text/html";break;case AscCommon.c_oAscClipboardDataFormat.Text:_data_format="text/plain";break;case AscCommon.c_oAscClipboardDataFormat.Internal:_data_format="text/x-custom";break;default:break}if(_data_format!=""&&_data!==null&&this.isCopyOutEnabled())if(_data_format=="text/x-custom")this.ClosureParams.setData(_data_format,"asc_internalData2;"+_data);else this.ClosureParams.setData(_data_format,
_data)},Button_Copy:function(){if(this.inputContext){if(this.inputContext.isHardCheckKeyboard)this.inputContext.enableVirtualKeyboard_Hard();this.inputContext.HtmlArea.focus()}this.Api.asc_enableKeyEvents(true,true);this.CommonDiv_Execute_CopyCut();var _ret=false;try{_ret=document.execCommand("copy")}catch(err){_ret=false}if(!_ret){this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal)}return _ret},
Button_Cut:function(){if(this.inputContext){if(this.inputContext.isHardCheckKeyboard)this.inputContext.enableVirtualKeyboard_Hard();this.inputContext.HtmlArea.focus()}this.Api.asc_enableKeyEvents(true,true);this.CommonDiv_Execute_CopyCut();var _ret=false;try{_ret=document.execCommand("cut")}catch(err){_ret=false}if(!_ret){this.LastCopyBinary=null;this.bCut=true;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal);
this.Api.asc_SelectionCut();this.bCut=false}return _ret},Button_Paste:function(){if(this.inputContext){if(this.inputContext.isHardCheckKeyboard)this.inputContext.enableVirtualKeyboard_Hard();this.inputContext.HtmlArea.focus()}this.Api.asc_enableKeyEvents(true,true);var _ret=false;try{_ret=document.execCommand("paste")}catch(err){_ret=false}if(!_ret&&null!=this.LastCopyBinary){var _data=null;var _isInternal=false;for(var i=0;i<this.LastCopyBinary.length;i++)if(c_oAscClipboardDataFormat.Internal==this.LastCopyBinary[i].type){this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Internal,
this.LastCopyBinary[i].data);_isInternal=true}if(!_isInternal&&this.LastCopyBinary.length>0)this.Api.asc_PasteData(this.LastCopyBinary[0].type,this.LastCopyBinary[0].data)}return _ret},ClearBuffer:function(){if(-1!=this.clearBufferTimerId)clearTimeout(this.clearBufferTimerId);this.clearBufferTimerId=setTimeout(function(){if(AscCommon.g_clipboardBase)AscCommon.g_clipboardBase.clearBufferTimerId=-1},500);this.Button_Copy()},isCopyOutEnabled:function(){if(this.Api&&this.Api.isCopyOutEnabled)return this.Api.isCopyOutEnabled();
return true}};function definePastedFrom(doc){if(!doc)return null;var res=null;var metaTags=doc.getElementsByTagName("meta");for(var i=0;i<metaTags.length;i++)if("ProgId"===metaTags[i].getAttribute("name")){var content=metaTags[i].getAttribute("content");if(null!==content)if(content.startsWith("Word"))res=c_oClipboardPastedFrom.Word;else if(content.startsWith("Excel"))res=c_oClipboardPastedFrom.Excel;else if(content.startsWith("PowerPoint"))res=c_oClipboardPastedFrom.PowerPoint}return res}function CSpecialPasteHelper(){this.Api=
null;this.specialPasteData={};this.specialPasteProps=null;this.showSpecialPasteButton=false;this.buttonInfo=new Asc.SpecialPasteShowOptions;this.specialPasteStart=false;this.pasteStart=false;this.bIsEndTransaction=false;this.showButtonIdParagraph=null;this.endRecalcDocument=false;this.doNotShowButton=false;this.visiblePasteButton=true;this.selectionRange=null;this.isAppliedOperation=false;this._formulaError=null}CSpecialPasteHelper.prototype={Init:function(_api){this.Api=_api},Special_Paste:function(props){this.Api.asc_SpecialPasteData(props);
return true},Clean_SpecialPasteObj:function(){this.specialPasteData={}},Special_Paste_Start:function(){this.specialPasteStart=true;if(g_clipboardBase.CommonIframe&&g_clipboardBase.CommonIframe.style.display!="block")g_clipboardBase.CommonIframe.style.display="block"},Special_Paste_End:function(){this.specialPasteStart=false;if(g_clipboardBase.CommonIframe&&g_clipboardBase.CommonIframe.style.display!="none")g_clipboardBase.CommonIframe.style.display="none"},Paste_Process_Start:function(doNotShowButton){if(doNotShowButton)this.Special_Paste_Hide_Button();
this.pasteStart=true;this._formulaError=null;AscFonts.IsCheckSymbols=true},Special_Paste_Hide_Button:function(){this.doNotShowButton=true},Paste_Process_End:function(checkEnd){if(!this.Api)return;AscFonts.IsCheckSymbols=false;this.pasteStart=false;this.specialPasteProps=null;this.bSaveFormat=false;if(this.specialPasteStart){this.Special_Paste_End();if(!this.buttonInfo.isClean()){this.buttonInfo.asc_setOptions(null);this.Api.asc_ShowSpecialPasteButton(this.buttonInfo)}}else this.SpecialPasteButton_Show();
if(!checkEnd||checkEnd&&this.endRecalcDocument)this.doNotShowButton=false;if(this.bIsEndTransaction){this.bIsEndTransaction=false;History.EndTransaction()}var _logicDoc=this.Api&&this.Api.WordControl?this.Api.WordControl.m_oLogicDocument:null;if(_logicDoc&&_logicDoc.Action&&_logicDoc.Action.Start&&this.Api._finalizeAction)this.Api._finalizeAction()},SpecialPasteButton_Show:function(){if(!this.Api||this.doNotShowButton||!this.visiblePasteButton)return;if(this.CheckFastCoEditing())return;var props=
this.buttonInfo;if(props&&props.options)if(window["Asc"]&&window["Asc"]["editor"]||props.cellCoord){this.showSpecialPasteButton=true;this.Api.asc_ShowSpecialPasteButton(props)}},SpecialPasteButtonById_Show:function(){if(!this.pasteStart)this.endRecalcDocument=true;if(!this.showButtonIdParagraph||this.pasteStart)return;if(!this.Api||!this.Api.asc_specialPasteShowButton||this.doNotShowButton||!this.visiblePasteButton){if(this.doNotShowButton)this.showButtonIdParagraph=null;this.doNotShowButton=false;
return}if(this.Api.asc_specialPasteShowButton())this.showSpecialPasteButton=true},SpecialPasteButton_Hide:function(needClean){if(!this.Api)return;if(this.showSpecialPasteButton){this.showSpecialPasteButton=false;this.CleanButtonInfo();this.Api.asc_HideSpecialPasteButton()}else if(needClean)this.CleanButtonInfo()},SpecialPasteButton_Update_Position:function(){if(!this.Api||!this.buttonInfo||this.buttonInfo.isClean())return;if(this.showSpecialPasteButton&&!this.pasteStart)this.Api.asc_UpdateSpecialPasteButton()},
CheckFastCoEditing:function(){if(!this.Api)return false;var res=false;var bFast=false;var bIsSingleUser=false;if(this.Api.collaborativeEditing){bFast=this.Api.collaborativeEditing.m_bFast;bIsSingleUser=!this.Api.collaborativeEditing.getCollaborativeEditing()}else{bFast=AscCommon.CollaborativeEditing.m_bFast;bIsSingleUser=AscCommon.CollaborativeEditing.Is_SingleUser()}if(bFast&&!bIsSingleUser)res=true;return res},CleanButtonInfo:function(){this.buttonInfo.clean()},GetPastedData:function(bText){if(bText&&
this.specialPasteData.text_data)return this.specialPasteData.text_data;return this.specialPasteData.data1},setVisiblePasteButton:function(val){this.visiblePasteButton=val;if(!val)this.SpecialPasteButton_Hide()}};var g_clipboardBase=new CClipboardBase;window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].g_clipboardBase=g_clipboardBase;var g_specialPasteHelper=new CSpecialPasteHelper;window["AscCommon"].g_specialPasteHelper=g_specialPasteHelper})(window);window["asc_desktop_copypaste"]=function(_api,
_method){var bIsFocus=_api.asc_IsFocus();if(!bIsFocus)_api.asc_enableKeyEvents(true);window["AscDesktopEditor"][_method]();if(!bIsFocus)_api.asc_enableKeyEvents(false)};"use strict";(function(window,undefined){window["AscInputMethod"]=window["AscInputMethod"]||{};function CKeyboardEventWrapper(e){this.altKey=e.altKey;this.ctrlKey=e.ctrlKey;this.metaKey=e.metaKey;this.shiftKey=e.shiftKey;this.charCode=e.charCode;this.keyCode=e.keyCode;this.which=e.which;this.code=e.code;this.key=e.key;this.srcElement=
e.srcElement;this.target=e.target;this._isDefaultPrevented=false}CKeyboardEventWrapper.prototype={preventDefault:function(){this._isDefaultPrevented=true},stopPropagation:function(){}};function CTextInput(api){this.Api=api;this.TargetId=null;this.HtmlDiv=null;this.TextArea_Not_ContentEditableDiv=true;this.HtmlArea=null;this.HtmlAreaOffset=50;this.HtmlAreaWidth=200;this.LockerTargetTimer=-1;this.KeyDownFlag=false;this.KeyPressFlag=false;this.IsLockTargetMode=false;this.nativeFocusElement=null;this.nativeFocusElementNoRemoveOnElementFocus=
false;this.InterfaceEnableKeyEvents=true;this.debugTexBoxMaxW=100;this.debugTexBoxMaxH=20;this.isDebug=false;this.isSystem=false;this.isShow=false;this.FixedPosCheckElementX=0;this.FixedPosCheckElementY=0;this.virtualKeyboardClickTimeout=-1;this.virtualKeyboardClickPrevent=false;this.TextBeforeComposition="";this.Text="";this.Target=0;this.CompositionStart=0;this.CompositionEnd=0;this.IsComposition=false;this.ApiIsComposition=false;this.TargetOffsetY=0;this.editorSdkW=0;this.editorSdkH=0;this.ReadOnlyCounter=
0;this.LastReplaceText=[];this.IsLastReplaceFlag=false;this.isNoClearOnFocus=false;this.keyPressInput="";this.isInputHelpersPresent=false;this.isInputHelpers={};this.isKeyPressOnUp=AscCommon.AscBrowser.isAppleDevices;this.keyPressOnUpCodes=[];this.isKeyPressOnUpStackedMode=this.isKeyPressOnUp;this.isHardCheckKeyboard=AscCommon.AscBrowser.isSailfish}CTextInput.prototype={log:function(_val){},init:function(target_id,parent_id){this.TargetId=target_id;var oHtmlParent=null;var oHtmlTarget=document.getElementById(this.TargetId);
if(undefined==parent_id)oHtmlParent=oHtmlTarget.parentNode;else oHtmlParent=document.getElementById(parent_id);this.HtmlDiv=document.createElement("div");this.HtmlDiv.id="area_id_parent";this.HtmlDiv.style.background="transparent";this.HtmlDiv.style.border="none";if(AscCommon.AscBrowser.isChrome)this.HtmlDiv.style.position="fixed";else this.HtmlDiv.style.position="absolute";this.HtmlDiv.style.zIndex=10;this.HtmlDiv.style.width="20px";this.HtmlDiv.style.height="50px";this.HtmlDiv.style.overflow="hidden";
this.HtmlDiv.style.boxSizing="content-box";this.HtmlDiv.style.webkitBoxSizing="content-box";this.HtmlDiv.style.MozBoxSizing="content-box";if(this.TextArea_Not_ContentEditableDiv)this.HtmlArea=document.createElement("textarea");else{this.HtmlArea=document.createElement("div");this.HtmlArea.setAttribute("contentEditable",true)}this.HtmlArea.id="area_id";if(this.Api.isViewMode&&this.Api.isMobileVersion)this.setReadOnlyWrapper(true);var _style="left:-"+(this.HtmlAreaWidth>>1)+"px;top:"+-this.HtmlAreaOffset+
"px;";_style+="background:transparent;border:none;position:absolute;text-shadow:0 0 0 #000;outline:none;color:transparent;width:"+this.HtmlAreaWidth+"px;height:50px;";_style+="overflow:hidden;padding:0px;margin:0px;font-family:arial;resize:none;font-weight:normal;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;";_style+="touch-action: none;-webkit-touch-callout: none;color:transparent;caret-color:transparent;";_style+=AscCommon.AscBrowser.isAppleDevices?"font-size:0px;":
"font-size:8px;";this.HtmlArea.setAttribute("style",_style);this.HtmlArea.setAttribute("spellcheck",false);this.HtmlArea.setAttribute("autocapitalize","none");this.HtmlArea.setAttribute("autocomplete","off");this.HtmlArea.setAttribute("autocorrect","off");this.HtmlDiv.appendChild(this.HtmlArea);if(true){var oHtmlDivScrollable=document.createElement("div");oHtmlDivScrollable.id="area_id_main";oHtmlDivScrollable.setAttribute("style","background:transparent;border:none;position:absolute;padding:0px;margin:0px;z-index:0;pointer-events:none;");
var parentStyle=getComputedStyle(oHtmlParent);oHtmlDivScrollable.style.left=parentStyle.left;oHtmlDivScrollable.style.top=parentStyle.top;oHtmlDivScrollable.style.width=parentStyle.width;oHtmlDivScrollable.style.height=parentStyle.height;oHtmlDivScrollable.style.overflow="hidden";oHtmlDivScrollable.appendChild(this.HtmlDiv);oHtmlParent.parentNode.appendChild(oHtmlDivScrollable)}else oHtmlParent.appendChild(this.HtmlDiv);var oThis=this;this.HtmlArea["onkeydown"]=function(e){if(AscCommon.AscBrowser.isSafariMacOs){var cmdButton=
e.ctrlKey||e.metaKey?true:false;var buttonCode=e.keyCode==67||e.keyCode==88||e.keyCode==86;if(cmdButton&&buttonCode)oThis.IsDisableKeyPress=true;else oThis.IsDisableKeyPress=false}return oThis.onKeyDown(e)};this.HtmlArea["onkeypress"]=function(e){if(oThis.IsDisableKeyPress==true){oThis.IsDisableKeyPress=false;var cmdButton=e.ctrlKey||e.metaKey?true:false;if(cmdButton)return}return oThis.onKeyPress(e)};this.HtmlArea["onkeyup"]=function(e){oThis.IsDisableKeyPress=false;return oThis.onKeyUp(e)};this.HtmlArea.addEventListener("input",
function(e){return oThis.onInput(e)},false);this.HtmlArea.addEventListener("compositionstart",function(e){return oThis.onCompositionStart(e)},false);this.HtmlArea.addEventListener("compositionupdate",function(e){return oThis.onCompositionUpdate(e)},false);this.HtmlArea.addEventListener("compositionend",function(e){return oThis.onCompositionEnd(e)},false);this.show();this.Api.Input_UpdatePos();if(AscCommon.AscBrowser.isAndroid)this.HtmlArea.onclick=function(e){var _this=AscCommon.g_inputContext;if(-1!=
_this.virtualKeyboardClickTimeout){clearTimeout(_this.virtualKeyboardClickTimeout);_this.virtualKeyboardClickTimeout=-1}_this.apiCompositeEnd();if(!_this.virtualKeyboardClickPrevent)return;_this.setReadOnlyWrapper(true);_this.virtualKeyboardClickPrevent=false;AscCommon.stopEvent(e);_this.virtualKeyboardClickTimeout=setTimeout(function(){_this.setReadOnlyWrapper(false);_this.virtualKeyboardClickTimeout=-1},1);return false}},onResize:function(_editorContainerId){var _elem=document.getElementById("area_id_main");
var _elemSrc=document.getElementById(_editorContainerId);if(!_elem||!_elemSrc)return;if(AscCommon.AscBrowser.isChrome){var rectObject=_elemSrc.getBoundingClientRect();this.FixedPosCheckElementX=rectObject.left;this.FixedPosCheckElementY=rectObject.top}var _width=_elemSrc.style.width;if((null==_width||""==_width)&&window.getComputedStyle){var _s=window.getComputedStyle(_elemSrc);_elem.style.left=_s.left;_elem.style.top=_s.top;_elem.style.width=_s.width;_elem.style.height=_s.height}else{_elem.style.left=
_elemSrc.style.left;_elem.style.top=_elemSrc.style.top;_elem.style.width=_width;_elem.style.height=_elemSrc.style.height}if(this.Api.isMobileVersion){var _elem1=document.getElementById("area_id_parent");var _elem2=document.getElementById("area_id");_elem1.parentNode.style.pointerEvents="";_elem1.style.left="0px";_elem1.style.top="-1000px";_elem1.style.right="0px";_elem1.style.bottom="-100px";_elem1.style.width="auto";_elem1.style.height="auto";_elem2.style.left="0px";_elem2.style.top="0px";_elem2.style.right=
"0px";_elem2.style.bottom="0px";_elem2.style.width="100%";_elem2.style.height="100%";if(AscCommon.AscBrowser.isIE){document.body.style["msTouchAction"]="none";document.body.style["touchAction"]="none"}}var _editorSdk=document.getElementById("editor_sdk");this.editorSdkW=_editorSdk.clientWidth;this.editorSdkH=_editorSdk.clientHeight},checkFocus:function(){if(this.Api.asc_IsFocus()&&!AscCommon.g_clipboardBase.IsFocus()&&!AscCommon.g_clipboardBase.IsWorking())if(document.activeElement!=this.HtmlArea)this.HtmlArea.focus()},
move:function(x,y){if(this.Api.isMobileVersion)return;var oTarget=document.getElementById(this.TargetId);if(!oTarget)return;var xPos=x?x:parseInt(oTarget.style.left);var yPos=(y?y:parseInt(oTarget.style.top))+parseInt(oTarget.style.height);if(AscCommon.AscBrowser.isSafari&&AscCommon.AscBrowser.isMobile)xPos=-100;if(!this.isDebug&&!this.isSystem){this.HtmlDiv.style.left=xPos+this.FixedPosCheckElementX+"px";this.HtmlDiv.style.top=yPos+this.FixedPosCheckElementY+this.TargetOffsetY+this.HtmlAreaOffset+
"px";this.HtmlArea.scrollTop=this.HtmlArea.scrollHeight}else this.debugCalculatePlace(xPos+this.FixedPosCheckElementX,yPos+this.FixedPosCheckElementY+this.TargetOffsetY);if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onTargetPositionChanged")},emulateKeyDownApi:function(code){var _e={altKey:false,ctrlKey:false,shiftKey:false,target:null,charCode:0,which:code,keyCode:code,code:"",preventDefault:function(){},stopPropagation:function(){}};this.Api.onKeyDown(_e);this.Api.onKeyUp(_e)},clear:function(isFromFocus){if(!this.TextArea_Not_ContentEditableDiv)this.HtmlArea.innerHTML=
"";else this.HtmlArea.value="";if(isFromFocus!==true)this.HtmlArea.focus();this.TextBeforeComposition="";this.Text="";this.Target=0;this.CompositionStart=0;this.CompositionEnd=0;this.IsComposition=false;this.keyPressInput="";if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperClear")},getAreaValue:function(){return this.TextArea_Not_ContentEditableDiv?this.HtmlArea.value:this.HtmlArea.innerText},setReadOnly:function(isLock){if(isLock)this.ReadOnlyCounter++;else this.ReadOnlyCounter--;
this.setReadOnlyWrapper(0>=this.ReadOnlyCounter?false:true)},setReadOnlyWrapper:function(val){this.HtmlArea.readOnly=this.Api.isViewMode?true:val},show:function(){if(this.isDebug||this.isSystem){this.log("ti: show");document.getElementById("area_id_main").style.zIndex=10;this.HtmlArea.style.top="0px";this.HtmlArea.style.width="100%";this.HtmlArea.style.height="100%";this.HtmlArea.style.background="#FFFFFF";this.HtmlArea.style.color="black";this.HtmlDiv.style.zIndex=90;this.HtmlDiv.style.border="2px solid #4363A4";
this.isShow=true}},unshow:function(isAttack){if(this.isDebug||this.isSystem||true==isAttack){this.log("ti: unshow");document.getElementById("area_id_main").style.zIndex=0;this.HtmlArea.style.top=-this.HtmlAreaOffset+"px";this.HtmlArea.style.width="1000px";this.HtmlArea.style.height="50px";this.HtmlArea.style.background="transparent";this.HtmlArea.style.color="transparent";this.HtmlDiv.style.zIndex=0;this.HtmlDiv.style.border="none";this.isShow=false}},debugCalculatePlace:function(x,y){var _left=x;
var _top=y;if(undefined==_left)_left=parseInt(this.HtmlDiv.style.left);if(undefined==_top)_top=parseInt(this.HtmlDiv.style.top);var _r_max=this.editorSdkW;var _b_max=this.editorSdkH;_r_max-=60;if(_r_max-_left>50)this.debugTexBoxMaxW=_r_max-_left;else{_left=_r_max-50;this.debugTexBoxMaxW=50}_b_max-=40;if(_b_max-_top>50)this.debugTexBoxMaxH=_b_max-_top;else{_top=_b_max-50;this.debugTexBoxMaxH=50}if(AscCommon.AscBrowser.isSafari&&AscCommon.AscBrowser.isMobile)_left=-100;this.HtmlDiv.style.left=_left+
"px";this.HtmlDiv.style.top=_top+"px";var _height=22;var _t=this.getAreaValue();if(0!=_t.length){var _editorSdk=document.getElementById("editor_sdk");var _p=document.createElement("p");_p.style.zIndex="-1";_p.style.position="absolute";_p.style.fontFamily="arial";_p.style.fontSize="12pt";_p.style.left="0px";_p.style.width=this.debugTexBoxMaxW+"px";_editorSdk.appendChild(_p);_t=_t.replace(/ /g,"&nbsp;");_p.innerHTML="<span>"+_t+"</span>";var _width=_p.firstChild.offsetWidth;_width=Math.min(_width+20,
this.debugTexBoxMaxW);if(AscCommon.AscBrowser.isIE)_width+=10;var area=document.createElement("textarea");area.style.zIndex="-1";area.id="area2_id";area.rows=1;area.setAttribute("style","font-family:arial;font-size:12pt;position:absolute;resize:none;padding:0px;margin:0px;font-weight:normal;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;");area.style.overflow="hidden";area.style.width=_width+"px";_editorSdk.appendChild(area);area.value=this.getAreaValue();_height=
area.clientHeight;if(area.scrollHeight>_height)_height=area.scrollHeight;_editorSdk.removeChild(_p);_editorSdk.removeChild(area)}if(_height>this.debugTexBoxMaxH)_height=this.debugTexBoxMaxH;this.HtmlDiv.style.width=_width+"px";this.HtmlDiv.style.height=_height+"px";var oldZindex=parseInt(this.HtmlDiv.style.zIndex);var newZindex=oldZindex==90?"89":"90";this.HtmlDiv.style.zIndex=newZindex},onInput:function(e,isFromCompositionUpdate){if(this.Api.isLongAction()||this.Api.isViewMode){AscCommon.stopEvent(e);
return false}if(this.isSystem){if(!this.isShow)this.show();this.debugCalculatePlace(undefined,undefined);return}if(this.isKeyPressOnUp&&this.keyPressOnUpCodes.length>0){if(!this.TextArea_Not_ContentEditableDiv)this.HtmlArea.innerHTML="";else this.HtmlArea.value="";this.TextBeforeComposition="";this.Text="";AscCommon.stopEvent(e);return false}this.log("ti: onInput");this.Text=this.getAreaValue();this.Text=this.Text.split("&nbsp;").join(" ");var codes=[];if(this.IsComposition||this.ApiIsComposition){var ieStart=
-1;var ieEnd=-1;if(true){var target=e.target;if(target["msGetInputContext"]){var ctx=target["msGetInputContext"]();if(ctx){ieStart=ctx["compositionStartOffset"];ieEnd=ctx["compositionEndOffset"]}}}this.CompositionEnd=this.Text.length;this.CompositionStart=this.TextBeforeComposition.length;var textReplace=this.Text.substr(this.CompositionStart);var iter;for(iter=textReplace.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());var isAsync=AscFonts.FontPickerByCharacter.checkTextLight(codes,
true);if(!isAsync){if(ieStart>this.CompositionStart){textReplace=textReplace.substr(0,ieStart-this.CompositionStart);codes=[];for(iter=textReplace.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());this.apiCompositeReplace(codes);this.apiCompositeEnd();this.TextBeforeComposition=this.Text.substr(0,ieStart);this.apiCompositeStart();this.CompositionStart=ieStart;codes=[];textReplace=this.Text.substr(this.CompositionStart);for(iter=textReplace.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());
this.apiCompositeReplace(codes)}else this.apiCompositeReplace(codes);if(!this.IsComposition){this.apiCompositeEnd();this.TextBeforeComposition=this.Text}}else{AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.apiCompositeReplace(codes);this.apiCompositeEnd();this.clear();this.setReadOnly(false)});AscCommon.stopEvent(e);this.setReadOnly(true);return false}}else{var textToApi=this.Text.substr(this.TextBeforeComposition.length);for(var iter=textToApi.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());
if(codes.length>0)this.apiInputText(codes);this.TextBeforeComposition=this.Text}if(!this.IsComposition)if(this.Text.length>0){var _lastCode=this.Text.charCodeAt(this.Text.length-1);if(_lastCode==12290||_lastCode==46){AscCommon.stopEvent(e);if(AscCommon.AscBrowser.isIE&&!AscCommon.AscBrowser.isIeEdge)setTimeout(function(){window["AscCommon"].g_inputContext.clear();window["AscCommon"].g_inputContext.HtmlArea.focus()},0);else this.clear();return false}}},emulateNativeKeyDown:function(e,target){var oEvent=
document.createEvent("KeyboardEvent");Object.defineProperty(oEvent,"keyCode",{get:function(){return this.keyCodeVal}});Object.defineProperty(oEvent,"which",{get:function(){return this.keyCodeVal}});Object.defineProperty(oEvent,"shiftKey",{get:function(){return this.shiftKeyVal}});Object.defineProperty(oEvent,"altKey",{get:function(){return this.altKeyVal}});Object.defineProperty(oEvent,"metaKey",{get:function(){return this.metaKeyVal}});Object.defineProperty(oEvent,"ctrlKey",{get:function(){return this.ctrlKeyVal}});
if(AscCommon.AscBrowser.isIE)oEvent.preventDefault=function(){try{Object.defineProperty(this,"defaultPrevented",{get:function(){return true}})}catch(err){}};var k=e.keyCode;if(oEvent.initKeyboardEvent)oEvent.initKeyboardEvent("keydown",true,true,window,false,false,false,false,k,k);else oEvent.initKeyEvent("keydown",true,true,window,false,false,false,false,k,0);oEvent.keyCodeVal=k;oEvent.shiftKeyVal=e.shiftKey;oEvent.altKeyVal=e.altKey;oEvent.metaKeyVal=e.metaKey;oEvent.ctrlKeyVal=e.ctrlKey;var _elem=
target?target:_getElementKeyboardDown(this.nativeFocusElement,3);_elem.dispatchEvent(oEvent);return oEvent.defaultPrevented},isSpaceSymbol:function(e){if(e.keyCode==32)return true;if(e.keyCode==229&&(e.code=="space"||e.code=="Space"||e.key=="Spacebar"))return true;return false},systemInputEnable:function(isEnabled){if(this.isSystem==isEnabled)return;this.isSystem=isEnabled;this.HtmlArea.style.left=this.isSystem?"0px":"-"+(this.HtmlAreaWidth>>1)+"px";this.clear();if(this.isShow)this.unshow(true);if(this.Api.WordControl&&
this.Api.WordControl.m_oLogicDocument&&this.Api.WordControl.m_oLogicDocument.Document_UpdateSelectionState)this.Api.WordControl.m_oLogicDocument.Document_UpdateSelectionState()},debugInputEnable:function(isEnabled){if(this.isDebug==isEnabled)return;this.isDebug=isEnabled;this.HtmlArea.style.left=this.isDebug?"0px":"-"+(this.HtmlAreaWidth>>1)+"px"},apiInputText:function(codes){var isAsync=AscFonts.FontPickerByCharacter.checkTextLight(codes,true);if(!isAsync){this.apiCompositeStart();this.apiCompositeReplace(codes);
this.apiCompositeEnd()}else{AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.apiCompositeStart();this.apiCompositeReplace(codes);this.apiCompositeEnd();this.setReadOnly(false)});this.setReadOnly(true);return false}},onKeyDown:function(e){if(this.Api.isLongAction()){AscCommon.stopEvent(e);return false}if(this.isInputHelpersPresent)switch(e.keyCode){case 9:case 13:case 38:case 40:case 33:case 34:case 35:case 36:case 27:{window.g_asc_plugins.onPluginEvent2("onKeyDown",{"keyCode":e.keyCode},
this.isInputHelpers);AscCommon.stopEvent(e);return false}case 32:{if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperInput",{"text":this.keyPressInput})}default:break}else if(32==e.keyCode);if(this.isSystem&&this.isShow){if(e.keyCode==13){var text=this.getAreaValue();var codes=[];for(var iter=text.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());this.apiInputText(codes);this.clear();this.unshow();AscCommon.stopEvent(e);return false}else if(e.keyCode==27){this.clear();
this.unshow();AscCommon.stopEvent(e);return false}return}if(null!=this.nativeFocusElement)if(this.emulateNativeKeyDown(e)){e.preventDefault();return false}var _code=e.keyCode;if(_code!=8&&_code!=46)this.KeyDownFlag=true;AscCommon.check_KeyboardEvent(e);var arrCodes=this.Api.getAddedTextOnKeyDown(AscCommon.global_keyboardEvent);var isAsync=AscFonts.FontPickerByCharacter.checkTextLight(arrCodes,true);if(isAsync){AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.onKeyDown(e);this.onKeyUp(e);
this.setReadOnly(false)});AscCommon.stopEvent(e);this.setReadOnly(true);return false}var ret=this.Api.onKeyDown(e);switch(e.keyCode){case 8:{var oldKeyPressInput=this.keyPressInput;this.clear();if(oldKeyPressInput.length>1){this.keyPressInput=oldKeyPressInput.substr(0,oldKeyPressInput.length-1);if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperInput",{"text":this.keyPressInput})}return false}case 9:case 13:case 37:case 38:case 39:case 40:case 33:case 34:case 35:case 36:{this.clear();
_internal!=""&&_internal.indexOf("asc_internalData2;")==0){this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Internal,_internal.substr("asc_internalData2;".length),null,_text_format);g_clipboardBase.Paste_End();return false}var _html_format=this.ClosureParams.getData("text/html");_html_format=_html_format.replace(/<img[^>]+>/g,"");if(!_html_format){this.PasteFlag=false;g_clipboardBase.Paste_End();return false}if(_html_format&&_html_format!=""){var nIndex=_html_format.indexOf("</html>");if(-1!=
nIndex)_html_format=_html_format.substring(0,nIndex+"</html>".length);this.CommonIframe_PasteStart(_html_format,_text_format);return false}if(_text_format&&_text_format!=""){this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Text,_text_format);g_clipboardBase.Paste_End();return false}var items=_clipboard.items;if(null!=items&&0!=items.length){g_clipboardBase.PasteImagesBody="";g_clipboardBase.PasteImagesCount=items.length;g_clipboardBase.PasteImagesCounter=0;for(var i=0;i<items.length;++i)if(items[i].kind==
"file"&&items[i].type.indexOf("image/")!==-1){var blob=items[i].getAsFile();var reader=new FileReader;reader.onload=function(e){g_clipboardBase.PasteImagesCounter++;g_clipboardBase.PasteImagesBody+='<img src="'+e.target.result+'"/>';if(g_clipboardBase.PasteImagesCounter==g_clipboardBase.PasteImagesCount){g_clipboardBase.CommonIframe_PasteStart("<html><body>"+g_clipboardBase.PasteImagesBody+"</body></html>");g_clipboardBase.PasteImagesBody="";g_clipboardBase.PasteImagesCounter=0;g_clipboardBase.PasteImagesCount=
0}};reader.onabort=reader.onerror=function(e){g_clipboardBase.PasteImagesCounter++;if(g_clipboardBase.PasteImagesCounter==g_clipboardBase.PasteImagesCount){g_clipboardBase.CommonIframe_PasteStart("<html><body>"+g_clipboardBase.PasteImagesBody+"</body></html>");g_clipboardBase.PasteImagesBody="";g_clipboardBase.PasteImagesCounter=0;g_clipboardBase.PasteImagesCount=0}};try{reader.readAsDataURL(blob)}catch(err){g_clipboardBase.PasteImagesCounter++}}else g_clipboardBase.PasteImagesCounter++;if(g_clipboardBase.PasteImagesCounter==
g_clipboardBase.PasteImagesCount)g_clipboardBase.Paste_End();return false}}g_clipboardBase.Paste_End();return false},_private_onbeforepaste:function(e,isAttackEmulate){this._console_log("onbeforepaste");if(!this.Api.asc_IsFocus(true))return;{this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.CommonDiv.focus();this.StartFocus();this.CommonDiv_Select();return}return false},_private_onbeforecopy_select:function(){if(AscBrowser.isIE){this._console_log("onbeforecopy_select");this.CommonDiv=
this.CommonDiv_Check();this.CommonDiv_Start();this.CommonDiv.innerHTML="<span> </span>";this.CommonDiv.focus();this.StartFocus();this.CommonDiv_Select()}},_private_onbeforecopy:function(e,isAttackEmulate){this._console_log("onbeforecopy");if(!this.Api.asc_IsFocus(true))return;{this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.CommonDiv.innerHTML="<span> </span>";this.CommonDiv.focus();this.StartFocus();this.CommonDiv_Select()}return false},Init:function(_api){this.Api=_api;window["AscCommon"].g_specialPasteHelper.Init(_api);
this.ClosureParams.getData=function(type){var _clipboard=this._e&&this._e.clipboardData?this._e.clipboardData:window.clipboardData;if(!_clipboard||!_clipboard.getData)return null;var _type=type;if(AscBrowser.isIE&&(type=="text"||type=="text/plain"))_type="Text";try{return _clipboard.getData(_type)}catch(e){}return null};this.ClosureParams.setData=function(type,_data){var _clipboard=this._e&&this._e.clipboardData?this._e.clipboardData:window.clipboardData;if(!_clipboard||!_clipboard.setData)return null;
var _type=type;if(AscBrowser.isIE&&(type=="text"||type=="text/plain"))_type="Text";try{_clipboard.setData(_type,_data)}catch(e){}};if(!AscBrowser.isIE){document.oncopy=function(e){return g_clipboardBase._private_oncopy(e)};document.oncut=function(e){return g_clipboardBase._private_oncut(e)};document.onpaste=function(e){return g_clipboardBase._private_onpaste(e)};document["onbeforecopy"]=function(e){return g_clipboardBase._private_onbeforecopy(e)};document["onbeforecut"]=function(e){return g_clipboardBase._private_onbeforecopy(e)};
document["onbeforepaste"]=function(e){return g_clipboardBase._private_onbeforepaste(e)}}else{document.addEventListener("copy",function(e){return g_clipboardBase._private_oncopy(e)});document.addEventListener("cut",function(e){return g_clipboardBase._private_oncut(e)});document.addEventListener("paste",function(e){return g_clipboardBase._private_onpaste(e)});document.addEventListener("beforepaste",function(e){return g_clipboardBase._private_onbeforepaste(e)});document.addEventListener("beforecopy",
function(e){return g_clipboardBase._private_onbeforecopy(e)});document.addEventListener("beforecut",function(e){return g_clipboardBase._private_onbeforecopy(e)})}if(this.IsCopyCutOnlyInEditable||this.IsPasteOnlyInEditable)document.onkeydown=function(e){if(!g_clipboardBase.Api.asc_IsFocus(true)||g_clipboardBase.Api.isLongAction())return;var isAltGr=AscCommon.getAltGr(e);if(isAltGr)return;var isCtrl=e.ctrlKey===true||e.metaKey===true;var isShift=e.shiftKey;var keyCode=e.keyCode;if(g_clipboardBase.IsCopyCutOnlyInEditable){var bIsBeforeCopyCutEmulate=
false;var _cut=false;if(isCtrl&&!isShift&&(keyCode==67||keyCode==88))bIsBeforeCopyCutEmulate=true;if(!isCtrl&&isShift&&keyCode==45){bIsBeforeCopyCutEmulate=true;_cut=true}if(bIsBeforeCopyCutEmulate){g_clipboardBase._console_log("emulate_beforecopycut");var isEmulate=false;try{isEmulate=_cut?document.execCommand("beforecut"):document.execCommand("beforecopy")}catch(err){}g_clipboardBase._private_onbeforecopy(undefined,!isEmulate)}}if(g_clipboardBase.IsPasteOnlyInEditable){var bIsBeforePasteEmulate=
false;if(isCtrl&&!isShift&&keyCode==86)bIsBeforePasteEmulate=true;if(!isCtrl&&isShift&&keyCode==45)bIsBeforePasteEmulate=true;if(bIsBeforePasteEmulate){g_clipboardBase._console_log("emulate_beforepaste");var isEmulate=false;try{isEmulate=document.execCommand("beforepaste")}catch(err$14){}g_clipboardBase._private_onbeforepaste(undefined,!isEmulate)}}};if(AscBrowser.isSafari&&false){this.CommonDiv=this.CommonDiv_Check();setInterval(function(){if(g_clipboardBase.Api.asc_IsFocus(true))g_clipboardBase.CommonDiv.focus()},
100)}},IsWorking:function(){return this.CopyFlag||this.PasteFlag?true:false},StartFocus:function(){this.EndFocus(false);this.CopyPasteFocus=true;this.CopyPasteFocusTimer=setTimeout(function(){g_clipboardBase.EndFocus()},1E3)},EndFocus:function(isFocusToEditor){this.CopyPasteFocus=false;if(-1!=this.CopyPasteFocusTimer){clearTimeout(this.CopyPasteFocusTimer);this.CopyPasteFocusTimer=-1;if(false!==isFocusToEditor&&null!=this.inputContext)if(this.inputContext.HtmlArea)this.inputContext.HtmlArea.focus()}},
IsFocus:function(){return this.CopyPasteFocus},CommonDiv_Check:function(){var ElemToSelect=document.getElementById(this.CommonDivId);if(!ElemToSelect){ElemToSelect=document.createElement("div");ElemToSelect.id=this.CommonDivId;ElemToSelect.className=this.CommonDivClassName;ElemToSelect.style.position="fixed";ElemToSelect.style.left="0px";ElemToSelect.style.top="-100px";ElemToSelect.style.width="10000px";ElemToSelect.style.height="100px";ElemToSelect.style.overflow="hidden";ElemToSelect.style.zIndex=
-1E3;ElemToSelect.style.MozUserSelect="text";ElemToSelect.style.fontFamily="onlyofficeDefaultFont";ElemToSelect.style.fontSize="11pt";ElemToSelect.style.color="black";ElemToSelect.style["-khtml-user-select"]="text";ElemToSelect.style["-o-user-select"]="text";ElemToSelect.style["user-select"]="text";ElemToSelect.style["-webkit-user-select"]="text";ElemToSelect.setAttribute("contentEditable",this.isCopyOutEnabled());var _parent=""==this.CommonDivIdParent?document.body:document.getElementById(this.CommonDivIdParent);
_parent.appendChild(ElemToSelect)}else ElemToSelect.setAttribute("contentEditable",this.isCopyOutEnabled());return ElemToSelect},CommonDiv_Select:function(){var ElemToSelect=this.CommonDiv;if(window.getSelection){var selection=window.getSelection();var rangeToSelect=document.createRange();var is_gecko=AscBrowser.isGecko;if(is_gecko){ElemToSelect.appendChild(document.createTextNode("\u00a0"));ElemToSelect.insertBefore(document.createTextNode("\u00a0"),ElemToSelect.firstChild);rangeToSelect.setStartAfter(ElemToSelect.firstChild);
rangeToSelect.setEndBefore(ElemToSelect.lastChild)}else{var aChildNodes=ElemToSelect.childNodes;if(aChildNodes.length==1){var elem=aChildNodes[0];var wrap=document.createElement("b");wrap.setAttribute("style","font-weight:normal; background-color: transparent; color: transparent;");elem=ElemToSelect.removeChild(elem);wrap.appendChild(elem);ElemToSelect.appendChild(wrap)}rangeToSelect.selectNodeContents(ElemToSelect)}selection.removeAllRanges();selection.addRange(rangeToSelect)}else if(document.body.createTextRange){var rangeToSelect=
document.body.createTextRange();rangeToSelect.moveToElementText(ElemToSelect);rangeToSelect.select()}},CommonDiv_Start:function(){this.ClosureParams.overflowBody=document.body.style.overflow;document.body.style.overflow="hidden";this.ClosureParams.backgroundcolorBody=document.body.style["background-color"];document.body.style["background-color"]="transparent";var ElemToSelect=this.CommonDiv;ElemToSelect.style.display="block";while(ElemToSelect.hasChildNodes())ElemToSelect.removeChild(ElemToSelect.lastChild);
document.body.style.MozUserSelect="text";delete document.body.style["-khtml-user-select"];delete document.body.style["-o-user-select"];delete document.body.style["user-select"];document.body.style["-webkit-user-select"]="text";ElemToSelect.style.MozUserSelect="all"},CommonDiv_End:function(){var ElemToSelect=this.CommonDiv;if(ElemToSelect){ElemToSelect.style.display=AscBrowser.isSafari?"block":"none";ElemToSelect.style.MozUserSelect="none"}document.body.style.MozUserSelect="none";document.body.style["-khtml-user-select"]=
"none";document.body.style["-o-user-select"]="none";document.body.style["user-select"]="none";document.body.style["-webkit-user-select"]="none";document.body.style["background-color"]=this.ClosureParams.backgroundcolorBody;document.body.style.overflow=this.ClosureParams.overflowBody;this.CopyFlag=false;this.bCut=false;this.EndFocus()},CommonDiv_Copy:function(){this.CopyFlag=true;this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.ClosureParams.isDivCopy=true;this.DivOnCopyHtmlPresent=
false;this.DivOnCopyText="";this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal);this.ClosureParams.isDivCopy=false;if(!this.DivOnCopyHtmlPresent&&this.DivOnCopyText!="")this.CommonDiv.innerHTML=this.DivOnCopyText;this.DivOnCopyHtmlPresent=false;this.DivOnCopyText="";this.CommonDiv_Select();window.setTimeout(function(){g_clipboardBase.CommonDiv_End()},0)},CommonDiv_Execute_CopyCut:function(){if(this.IsCopyCutOnlyInEditable)this._private_onbeforecopy(undefined,
true)},CommonIframe_PasteStart:function(_html_data,text_data){var ifr=document.getElementById(this.CommonIframeId);if(!ifr){ifr=document.createElement("iframe");ifr.name=this.CommonIframeId;ifr.id=this.CommonIframeId;ifr.style.position="absolute";ifr.style.top="-100px";ifr.style.left="0px";ifr.style.width="10000px";ifr.style.height="100px";ifr.style.overflow="hidden";ifr.style.zIndex=-1E3;ifr.setAttribute("sandbox","allow-same-origin");document.body.appendChild(ifr);this.CommonIframe=ifr}else ifr.style.width=
"10000px";var frameWindow=window.frames[this.CommonIframeId];if(frameWindow){frameWindow.document.open();frameWindow.document.write(_html_data);frameWindow.document.close();if(null!=frameWindow.document&&null!=frameWindow.document.body){ifr.style.display="block";this.pastedFrom=definePastedFrom(frameWindow.document);this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.HtmlElement,frameWindow.document.body,ifr,text_data)}}ifr.style.width="100px";g_clipboardBase.Paste_End()},CommonIframe_PasteEnd:function(){if(this.CommonIframe&&
this.CommonIframe.style.display!="none"){this.CommonIframe.blur();this.CommonIframe.style.display="none"}},Paste_End:function(){this.CommonIframe_PasteEnd();this.Api.decrementCounterLongAction();this.PasteFlag=false;this.EndFocus();if(this.needClearBuffer){this.ClearBuffer();this.needClearBuffer=false}},pushData:function(_format,_data){if(null==this.LastCopyBinary)this.LastCopyBinary=[];this.LastCopyBinary.push({type:_format,data:_data});if(this.ClosureParams.isDivCopy===true){if(!this.isCopyOutEnabled())return;
if(_format==AscCommon.c_oAscClipboardDataFormat.Html){this.CommonDiv.innerHTML=_data;this.DivOnCopyHtmlPresent=true}if(_format==AscCommon.c_oAscClipboardDataFormat.Text)this.DivOnCopyText=_data;return}var _data_format="";switch(_format){case AscCommon.c_oAscClipboardDataFormat.Html:_data_format="text/html";break;case AscCommon.c_oAscClipboardDataFormat.Text:_data_format="text/plain";break;case AscCommon.c_oAscClipboardDataFormat.Internal:_data_format="text/x-custom";break;default:break}if(_data_format!=
""&&_data!==null&&this.isCopyOutEnabled())if(_data_format=="text/x-custom")this.ClosureParams.setData(_data_format,"asc_internalData2;"+_data);else this.ClosureParams.setData(_data_format,_data)},Button_Copy:function(){if(this.inputContext){if(this.inputContext.isHardCheckKeyboard)this.inputContext.enableVirtualKeyboard_Hard();this.inputContext.HtmlArea.focus()}this.Api.asc_enableKeyEvents(true,true);this.CommonDiv_Execute_CopyCut();var _ret=false;try{_ret=document.execCommand("copy")}catch(err){_ret=
false}if(!_ret){this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal)}return _ret},Button_Cut:function(){if(this.inputContext){if(this.inputContext.isHardCheckKeyboard)this.inputContext.enableVirtualKeyboard_Hard();this.inputContext.HtmlArea.focus()}this.Api.asc_enableKeyEvents(true,true);this.CommonDiv_Execute_CopyCut();var _ret=false;try{_ret=document.execCommand("cut")}catch(err){_ret=
false}if(!_ret){this.LastCopyBinary=null;this.bCut=true;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal);this.Api.asc_SelectionCut();this.bCut=false}return _ret},Button_Paste:function(){if(this.inputContext){if(this.inputContext.isHardCheckKeyboard)this.inputContext.enableVirtualKeyboard_Hard();this.inputContext.HtmlArea.focus()}this.Api.asc_enableKeyEvents(true,true);var _ret=false;try{_ret=document.execCommand("paste")}catch(err){_ret=
false}if(!_ret&&null!=this.LastCopyBinary){var _data=null;var _isInternal=false;for(var i=0;i<this.LastCopyBinary.length;i++)if(c_oAscClipboardDataFormat.Internal==this.LastCopyBinary[i].type){this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Internal,this.LastCopyBinary[i].data);_isInternal=true}if(!_isInternal&&this.LastCopyBinary.length>0)this.Api.asc_PasteData(this.LastCopyBinary[0].type,this.LastCopyBinary[0].data)}return _ret},ClearBuffer:function(){if(-1!=this.clearBufferTimerId)clearTimeout(this.clearBufferTimerId);
this.clearBufferTimerId=setTimeout(function(){if(AscCommon.g_clipboardBase)AscCommon.g_clipboardBase.clearBufferTimerId=-1},500);this.Button_Copy()},isCopyOutEnabled:function(){if(this.Api&&this.Api.isCopyOutEnabled)return this.Api.isCopyOutEnabled();return true}};function definePastedFrom(doc){if(!doc)return null;var res=null;var metaTags=doc.getElementsByTagName("meta");for(var i=0;i<metaTags.length;i++)if("ProgId"===metaTags[i].getAttribute("name")){var content=metaTags[i].getAttribute("content");
if(null!==content)if(content.startsWith("Word"))res=c_oClipboardPastedFrom.Word;else if(content.startsWith("Excel"))res=c_oClipboardPastedFrom.Excel;else if(content.startsWith("PowerPoint"))res=c_oClipboardPastedFrom.PowerPoint}return res}function CSpecialPasteHelper(){this.Api=null;this.specialPasteData={};this.specialPasteProps=null;this.showSpecialPasteButton=false;this.buttonInfo=new Asc.SpecialPasteShowOptions;this.specialPasteStart=false;this.pasteStart=false;this.bIsEndTransaction=false;this.showButtonIdParagraph=
null;this.endRecalcDocument=false;this.doNotShowButton=false;this.visiblePasteButton=true;this.selectionRange=null;this.isAppliedOperation=false;this._formulaError=null}CSpecialPasteHelper.prototype={Init:function(_api){this.Api=_api},Special_Paste:function(props){this.Api.asc_SpecialPasteData(props);return true},Clean_SpecialPasteObj:function(){this.specialPasteData={}},Special_Paste_Start:function(){this.specialPasteStart=true;if(g_clipboardBase.CommonIframe&&g_clipboardBase.CommonIframe.style.display!=
"block")g_clipboardBase.CommonIframe.style.display="block"},Special_Paste_End:function(){this.specialPasteStart=false;if(g_clipboardBase.CommonIframe&&g_clipboardBase.CommonIframe.style.display!="none")g_clipboardBase.CommonIframe.style.display="none"},Paste_Process_Start:function(doNotShowButton){if(doNotShowButton)this.Special_Paste_Hide_Button();this.pasteStart=true;this._formulaError=null;AscFonts.IsCheckSymbols=true},Special_Paste_Hide_Button:function(){this.doNotShowButton=true},Paste_Process_End:function(checkEnd){if(!this.Api)return;
AscFonts.IsCheckSymbols=false;this.pasteStart=false;this.specialPasteProps=null;this.bSaveFormat=false;if(this.specialPasteStart){this.Special_Paste_End();if(!this.buttonInfo.isClean()){this.buttonInfo.asc_setOptions(null);this.Api.asc_ShowSpecialPasteButton(this.buttonInfo)}}else this.SpecialPasteButton_Show();if(!checkEnd||checkEnd&&this.endRecalcDocument)this.doNotShowButton=false;if(this.bIsEndTransaction){this.bIsEndTransaction=false;History.EndTransaction()}var _logicDoc=this.Api&&this.Api.WordControl?
this.Api.WordControl.m_oLogicDocument:null;if(_logicDoc&&_logicDoc.Action&&_logicDoc.Action.Start&&this.Api._finalizeAction)this.Api._finalizeAction()},SpecialPasteButton_Show:function(){if(!this.Api||this.doNotShowButton||!this.visiblePasteButton)return;if(this.CheckFastCoEditing())return;var props=this.buttonInfo;if(props&&props.options)if(window["Asc"]&&window["Asc"]["editor"]||props.cellCoord){this.showSpecialPasteButton=true;this.Api.asc_ShowSpecialPasteButton(props)}},SpecialPasteButtonById_Show:function(){if(!this.pasteStart)this.endRecalcDocument=
true;if(!this.showButtonIdParagraph||this.pasteStart)return;if(!this.Api||!this.Api.asc_specialPasteShowButton||this.doNotShowButton||!this.visiblePasteButton){if(this.doNotShowButton)this.showButtonIdParagraph=null;this.doNotShowButton=false;return}if(this.Api.asc_specialPasteShowButton())this.showSpecialPasteButton=true},SpecialPasteButton_Hide:function(needClean){if(!this.Api)return;if(this.showSpecialPasteButton){this.showSpecialPasteButton=false;this.CleanButtonInfo();this.Api.asc_HideSpecialPasteButton()}else if(needClean)this.CleanButtonInfo()},
SpecialPasteButton_Update_Position:function(){if(!this.Api||!this.buttonInfo||this.buttonInfo.isClean())return;if(this.showSpecialPasteButton&&!this.pasteStart)this.Api.asc_UpdateSpecialPasteButton()},CheckFastCoEditing:function(){if(!this.Api)return false;var res=false;var bFast=false;var bIsSingleUser=false;if(this.Api.collaborativeEditing){bFast=this.Api.collaborativeEditing.m_bFast;bIsSingleUser=!this.Api.collaborativeEditing.getCollaborativeEditing()}else{bFast=AscCommon.CollaborativeEditing.m_bFast;
bIsSingleUser=AscCommon.CollaborativeEditing.Is_SingleUser()}if(bFast&&!bIsSingleUser)res=true;return res},CleanButtonInfo:function(){this.buttonInfo.clean()},GetPastedData:function(bText){if(bText&&this.specialPasteData.text_data)return this.specialPasteData.text_data;return this.specialPasteData.data1},setVisiblePasteButton:function(val){this.visiblePasteButton=val;if(!val)this.SpecialPasteButton_Hide()}};var g_clipboardBase=new CClipboardBase;window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].g_clipboardBase=
g_clipboardBase;var g_specialPasteHelper=new CSpecialPasteHelper;window["AscCommon"].g_specialPasteHelper=g_specialPasteHelper})(window);window["asc_desktop_copypaste"]=function(_api,_method){var bIsFocus=_api.asc_IsFocus();if(!bIsFocus)_api.asc_enableKeyEvents(true);window["AscDesktopEditor"][_method]();if(!bIsFocus)_api.asc_enableKeyEvents(false)};"use strict";(function(window,undefined){window["AscInputMethod"]=window["AscInputMethod"]||{};function CKeyboardEventWrapper(e){this.altKey=e.altKey;
this.ctrlKey=e.ctrlKey;this.metaKey=e.metaKey;this.shiftKey=e.shiftKey;this.charCode=e.charCode;this.keyCode=e.keyCode;this.which=e.which;this.code=e.code;this.key=e.key;this.srcElement=e.srcElement;this.target=e.target;this._isDefaultPrevented=false}CKeyboardEventWrapper.prototype={preventDefault:function(){this._isDefaultPrevented=true},stopPropagation:function(){}};function CTextInput(api){this.Api=api;this.TargetId=null;this.HtmlDiv=null;this.TextArea_Not_ContentEditableDiv=true;this.HtmlArea=
null;this.HtmlAreaOffset=50;this.HtmlAreaWidth=200;this.LockerTargetTimer=-1;this.KeyDownFlag=false;this.KeyPressFlag=false;this.IsLockTargetMode=false;this.nativeFocusElement=null;this.nativeFocusElementNoRemoveOnElementFocus=false;this.InterfaceEnableKeyEvents=true;this.debugTexBoxMaxW=100;this.debugTexBoxMaxH=20;this.isDebug=false;this.isSystem=false;this.isShow=false;this.FixedPosCheckElementX=0;this.FixedPosCheckElementY=0;this.virtualKeyboardClickTimeout=-1;this.virtualKeyboardClickPrevent=
false;this.TextBeforeComposition="";this.Text="";this.Target=0;this.CompositionStart=0;this.CompositionEnd=0;this.IsComposition=false;this.ApiIsComposition=false;this.TargetOffsetY=0;this.editorSdkW=0;this.editorSdkH=0;this.ReadOnlyCounter=0;this.LastReplaceText=[];this.IsLastReplaceFlag=false;this.isNoClearOnFocus=false;this.keyPressInput="";this.isInputHelpersPresent=false;this.isInputHelpers={};this.isKeyPressOnUp=AscCommon.AscBrowser.isAppleDevices;this.keyPressOnUpCodes=[];this.isKeyPressOnUpStackedMode=
this.isKeyPressOnUp;this.isHardCheckKeyboard=AscCommon.AscBrowser.isSailfish}CTextInput.prototype={log:function(_val){},init:function(target_id,parent_id){this.TargetId=target_id;var oHtmlParent=null;var oHtmlTarget=document.getElementById(this.TargetId);if(undefined==parent_id)oHtmlParent=oHtmlTarget.parentNode;else oHtmlParent=document.getElementById(parent_id);this.HtmlDiv=document.createElement("div");this.HtmlDiv.id="area_id_parent";this.HtmlDiv.style.background="transparent";this.HtmlDiv.style.border=
"none";if(AscCommon.AscBrowser.isChrome)this.HtmlDiv.style.position="fixed";else this.HtmlDiv.style.position="absolute";this.HtmlDiv.style.zIndex=10;this.HtmlDiv.style.width="20px";this.HtmlDiv.style.height="50px";this.HtmlDiv.style.overflow="hidden";this.HtmlDiv.style.boxSizing="content-box";this.HtmlDiv.style.webkitBoxSizing="content-box";this.HtmlDiv.style.MozBoxSizing="content-box";if(this.TextArea_Not_ContentEditableDiv)this.HtmlArea=document.createElement("textarea");else{this.HtmlArea=document.createElement("div");
this.HtmlArea.setAttribute("contentEditable",true)}this.HtmlArea.id="area_id";if(this.Api.isViewMode&&this.Api.isMobileVersion)this.setReadOnlyWrapper(true);var _style="left:-"+(this.HtmlAreaWidth>>1)+"px;top:"+-this.HtmlAreaOffset+"px;";_style+="background:transparent;border:none;position:absolute;text-shadow:0 0 0 #000;outline:none;color:transparent;width:"+this.HtmlAreaWidth+"px;height:50px;";_style+="overflow:hidden;padding:0px;margin:0px;font-family:arial;resize:none;font-weight:normal;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;";
_style+="touch-action: none;-webkit-touch-callout: none;color:transparent;caret-color:transparent;";_style+=AscCommon.AscBrowser.isAppleDevices?"font-size:0px;":"font-size:8px;";this.HtmlArea.setAttribute("style",_style);this.HtmlArea.setAttribute("spellcheck",false);this.HtmlArea.setAttribute("autocapitalize","none");this.HtmlArea.setAttribute("autocomplete","off");this.HtmlArea.setAttribute("autocorrect","off");this.HtmlDiv.appendChild(this.HtmlArea);if(true){var oHtmlDivScrollable=document.createElement("div");
oHtmlDivScrollable.id="area_id_main";oHtmlDivScrollable.setAttribute("style","background:transparent;border:none;position:absolute;padding:0px;margin:0px;z-index:0;pointer-events:none;");var parentStyle=getComputedStyle(oHtmlParent);oHtmlDivScrollable.style.left=parentStyle.left;oHtmlDivScrollable.style.top=parentStyle.top;oHtmlDivScrollable.style.width=parentStyle.width;oHtmlDivScrollable.style.height=parentStyle.height;oHtmlDivScrollable.style.overflow="hidden";oHtmlDivScrollable.appendChild(this.HtmlDiv);
oHtmlParent.parentNode.appendChild(oHtmlDivScrollable)}else oHtmlParent.appendChild(this.HtmlDiv);var oThis=this;this.HtmlArea["onkeydown"]=function(e){if(AscCommon.AscBrowser.isSafariMacOs){var cmdButton=e.ctrlKey||e.metaKey?true:false;var buttonCode=e.keyCode==67||e.keyCode==88||e.keyCode==86;if(cmdButton&&buttonCode)oThis.IsDisableKeyPress=true;else oThis.IsDisableKeyPress=false}return oThis.onKeyDown(e)};this.HtmlArea["onkeypress"]=function(e){if(oThis.IsDisableKeyPress==true){oThis.IsDisableKeyPress=
false;var cmdButton=e.ctrlKey||e.metaKey?true:false;if(cmdButton)return}return oThis.onKeyPress(e)};this.HtmlArea["onkeyup"]=function(e){oThis.IsDisableKeyPress=false;return oThis.onKeyUp(e)};this.HtmlArea.addEventListener("input",function(e){return oThis.onInput(e)},false);this.HtmlArea.addEventListener("compositionstart",function(e){return oThis.onCompositionStart(e)},false);this.HtmlArea.addEventListener("compositionupdate",function(e){return oThis.onCompositionUpdate(e)},false);this.HtmlArea.addEventListener("compositionend",
function(e){return oThis.onCompositionEnd(e)},false);this.show();this.Api.Input_UpdatePos();if(AscCommon.AscBrowser.isAndroid)this.HtmlArea.onclick=function(e){var _this=AscCommon.g_inputContext;if(-1!=_this.virtualKeyboardClickTimeout){clearTimeout(_this.virtualKeyboardClickTimeout);_this.virtualKeyboardClickTimeout=-1}_this.apiCompositeEnd();if(!_this.virtualKeyboardClickPrevent)return;_this.setReadOnlyWrapper(true);_this.virtualKeyboardClickPrevent=false;AscCommon.stopEvent(e);_this.virtualKeyboardClickTimeout=
setTimeout(function(){_this.setReadOnlyWrapper(false);_this.virtualKeyboardClickTimeout=-1},1);return false}},onResize:function(_editorContainerId){var _elem=document.getElementById("area_id_main");var _elemSrc=document.getElementById(_editorContainerId);if(!_elem||!_elemSrc)return;if(AscCommon.AscBrowser.isChrome){var rectObject=_elemSrc.getBoundingClientRect();this.FixedPosCheckElementX=rectObject.left;this.FixedPosCheckElementY=rectObject.top}var _width=_elemSrc.style.width;if((null==_width||""==
_width)&&window.getComputedStyle){var _s=window.getComputedStyle(_elemSrc);_elem.style.left=_s.left;_elem.style.top=_s.top;_elem.style.width=_s.width;_elem.style.height=_s.height}else{_elem.style.left=_elemSrc.style.left;_elem.style.top=_elemSrc.style.top;_elem.style.width=_width;_elem.style.height=_elemSrc.style.height}if(this.Api.isMobileVersion){var _elem1=document.getElementById("area_id_parent");var _elem2=document.getElementById("area_id");_elem1.parentNode.style.pointerEvents="";_elem1.style.left=
"0px";_elem1.style.top="-1000px";_elem1.style.right="0px";_elem1.style.bottom="-100px";_elem1.style.width="auto";_elem1.style.height="auto";_elem2.style.left="0px";_elem2.style.top="0px";_elem2.style.right="0px";_elem2.style.bottom="0px";_elem2.style.width="100%";_elem2.style.height="100%";if(AscCommon.AscBrowser.isIE){document.body.style["msTouchAction"]="none";document.body.style["touchAction"]="none"}}var _editorSdk=document.getElementById("editor_sdk");this.editorSdkW=_editorSdk.clientWidth;this.editorSdkH=
_editorSdk.clientHeight},checkFocus:function(){if(this.Api.asc_IsFocus()&&!AscCommon.g_clipboardBase.IsFocus()&&!AscCommon.g_clipboardBase.IsWorking())if(document.activeElement!=this.HtmlArea)this.HtmlArea.focus()},move:function(x,y){if(this.Api.isMobileVersion)return;var oTarget=document.getElementById(this.TargetId);if(!oTarget)return;var xPos=x?x:parseInt(oTarget.style.left);var yPos=(y?y:parseInt(oTarget.style.top))+parseInt(oTarget.style.height);if(AscCommon.AscBrowser.isSafari&&AscCommon.AscBrowser.isMobile)xPos=
-100;if(!this.isDebug&&!this.isSystem){this.HtmlDiv.style.left=xPos+this.FixedPosCheckElementX+"px";this.HtmlDiv.style.top=yPos+this.FixedPosCheckElementY+this.TargetOffsetY+this.HtmlAreaOffset+"px";this.HtmlArea.scrollTop=this.HtmlArea.scrollHeight}else this.debugCalculatePlace(xPos+this.FixedPosCheckElementX,yPos+this.FixedPosCheckElementY+this.TargetOffsetY);if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onTargetPositionChanged")},emulateKeyDownApi:function(code){var _e={altKey:false,
ctrlKey:false,shiftKey:false,target:null,charCode:0,which:code,keyCode:code,code:"",preventDefault:function(){},stopPropagation:function(){}};this.Api.onKeyDown(_e);this.Api.onKeyUp(_e)},clear:function(isFromFocus){if(!this.TextArea_Not_ContentEditableDiv)this.HtmlArea.innerHTML="";else this.HtmlArea.value="";if(isFromFocus!==true)this.HtmlArea.focus();this.TextBeforeComposition="";this.Text="";this.Target=0;this.CompositionStart=0;this.CompositionEnd=0;this.IsComposition=false;this.keyPressInput=
"";if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperClear")},getAreaValue:function(){return this.TextArea_Not_ContentEditableDiv?this.HtmlArea.value:this.HtmlArea.innerText},setReadOnly:function(isLock){if(isLock)this.ReadOnlyCounter++;else this.ReadOnlyCounter--;this.setReadOnlyWrapper(0>=this.ReadOnlyCounter?false:true)},setReadOnlyWrapper:function(val){this.HtmlArea.readOnly=this.Api.isViewMode?true:val},show:function(){if(this.isDebug||this.isSystem){this.log("ti: show");
document.getElementById("area_id_main").style.zIndex=10;this.HtmlArea.style.top="0px";this.HtmlArea.style.width="100%";this.HtmlArea.style.height="100%";this.HtmlArea.style.background="#FFFFFF";this.HtmlArea.style.color="black";this.HtmlDiv.style.zIndex=90;this.HtmlDiv.style.border="2px solid #4363A4";this.isShow=true}},unshow:function(isAttack){if(this.isDebug||this.isSystem||true==isAttack){this.log("ti: unshow");document.getElementById("area_id_main").style.zIndex=0;this.HtmlArea.style.top=-this.HtmlAreaOffset+
"px";this.HtmlArea.style.width="1000px";this.HtmlArea.style.height="50px";this.HtmlArea.style.background="transparent";this.HtmlArea.style.color="transparent";this.HtmlDiv.style.zIndex=0;this.HtmlDiv.style.border="none";this.isShow=false}},debugCalculatePlace:function(x,y){var _left=x;var _top=y;if(undefined==_left)_left=parseInt(this.HtmlDiv.style.left);if(undefined==_top)_top=parseInt(this.HtmlDiv.style.top);var _r_max=this.editorSdkW;var _b_max=this.editorSdkH;_r_max-=60;if(_r_max-_left>50)this.debugTexBoxMaxW=
_r_max-_left;else{_left=_r_max-50;this.debugTexBoxMaxW=50}_b_max-=40;if(_b_max-_top>50)this.debugTexBoxMaxH=_b_max-_top;else{_top=_b_max-50;this.debugTexBoxMaxH=50}if(AscCommon.AscBrowser.isSafari&&AscCommon.AscBrowser.isMobile)_left=-100;this.HtmlDiv.style.left=_left+"px";this.HtmlDiv.style.top=_top+"px";var _height=22;var _t=this.getAreaValue();if(0!=_t.length){var _editorSdk=document.getElementById("editor_sdk");var _p=document.createElement("p");_p.style.zIndex="-1";_p.style.position="absolute";
_p.style.fontFamily="arial";_p.style.fontSize="12pt";_p.style.left="0px";_p.style.width=this.debugTexBoxMaxW+"px";_editorSdk.appendChild(_p);_t=_t.replace(/ /g,"&nbsp;");_p.innerHTML="<span>"+_t+"</span>";var _width=_p.firstChild.offsetWidth;_width=Math.min(_width+20,this.debugTexBoxMaxW);if(AscCommon.AscBrowser.isIE)_width+=10;var area=document.createElement("textarea");area.style.zIndex="-1";area.id="area2_id";area.rows=1;area.setAttribute("style","font-family:arial;font-size:12pt;position:absolute;resize:none;padding:0px;margin:0px;font-weight:normal;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;");
area.style.overflow="hidden";area.style.width=_width+"px";_editorSdk.appendChild(area);area.value=this.getAreaValue();_height=area.clientHeight;if(area.scrollHeight>_height)_height=area.scrollHeight;_editorSdk.removeChild(_p);_editorSdk.removeChild(area)}if(_height>this.debugTexBoxMaxH)_height=this.debugTexBoxMaxH;this.HtmlDiv.style.width=_width+"px";this.HtmlDiv.style.height=_height+"px";var oldZindex=parseInt(this.HtmlDiv.style.zIndex);var newZindex=oldZindex==90?"89":"90";this.HtmlDiv.style.zIndex=
newZindex},onInput:function(e,isFromCompositionUpdate){if(this.Api.isLongAction()||this.Api.isViewMode){AscCommon.stopEvent(e);return false}if(this.isSystem){if(!this.isShow)this.show();this.debugCalculatePlace(undefined,undefined);return}if(this.isKeyPressOnUp&&this.keyPressOnUpCodes.length>0){if(!this.TextArea_Not_ContentEditableDiv)this.HtmlArea.innerHTML="";else this.HtmlArea.value="";this.TextBeforeComposition="";this.Text="";AscCommon.stopEvent(e);return false}this.log("ti: onInput");this.Text=
this.getAreaValue();this.Text=this.Text.split("&nbsp;").join(" ");var codes=[];if(this.IsComposition||this.ApiIsComposition){var ieStart=-1;var ieEnd=-1;if(true){var target=e.target;if(target["msGetInputContext"]){var ctx=target["msGetInputContext"]();if(ctx){ieStart=ctx["compositionStartOffset"];ieEnd=ctx["compositionEndOffset"]}}}this.CompositionEnd=this.Text.length;this.CompositionStart=this.TextBeforeComposition.length;var textReplace=this.Text.substr(this.CompositionStart);var iter;for(iter=
textReplace.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());var isAsync=AscFonts.FontPickerByCharacter.checkTextLight(codes,true);if(!isAsync){if(ieStart>this.CompositionStart){textReplace=textReplace.substr(0,ieStart-this.CompositionStart);codes=[];for(iter=textReplace.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());this.apiCompositeReplace(codes);this.apiCompositeEnd();this.TextBeforeComposition=this.Text.substr(0,ieStart);this.apiCompositeStart();this.CompositionStart=
ieStart;codes=[];textReplace=this.Text.substr(this.CompositionStart);for(iter=textReplace.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());this.apiCompositeReplace(codes)}else this.apiCompositeReplace(codes);if(!this.IsComposition){this.apiCompositeEnd();this.TextBeforeComposition=this.Text}}else{AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.apiCompositeReplace(codes);this.apiCompositeEnd();this.clear();this.setReadOnly(false)});AscCommon.stopEvent(e);this.setReadOnly(true);
return false}}else{var textToApi=this.Text.substr(this.TextBeforeComposition.length);for(var iter=textToApi.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());if(codes.length>0)this.apiInputText(codes);this.TextBeforeComposition=this.Text}if(!this.IsComposition)if(this.Text.length>0){var _lastCode=this.Text.charCodeAt(this.Text.length-1);if(_lastCode==12290||_lastCode==46){AscCommon.stopEvent(e);if(AscCommon.AscBrowser.isIE&&!AscCommon.AscBrowser.isIeEdge)setTimeout(function(){window["AscCommon"].g_inputContext.clear();
window["AscCommon"].g_inputContext.HtmlArea.focus()},0);else this.clear();return false}}},emulateNativeKeyDown:function(e,target){var oEvent=document.createEvent("KeyboardEvent");Object.defineProperty(oEvent,"keyCode",{get:function(){return this.keyCodeVal}});Object.defineProperty(oEvent,"which",{get:function(){return this.keyCodeVal}});Object.defineProperty(oEvent,"shiftKey",{get:function(){return this.shiftKeyVal}});Object.defineProperty(oEvent,"altKey",{get:function(){return this.altKeyVal}});
Object.defineProperty(oEvent,"metaKey",{get:function(){return this.metaKeyVal}});Object.defineProperty(oEvent,"ctrlKey",{get:function(){return this.ctrlKeyVal}});if(AscCommon.AscBrowser.isIE)oEvent.preventDefault=function(){try{Object.defineProperty(this,"defaultPrevented",{get:function(){return true}})}catch(err){}};var k=e.keyCode;if(oEvent.initKeyboardEvent)oEvent.initKeyboardEvent("keydown",true,true,window,false,false,false,false,k,k);else oEvent.initKeyEvent("keydown",true,true,window,false,
false,false,false,k,0);oEvent.keyCodeVal=k;oEvent.shiftKeyVal=e.shiftKey;oEvent.altKeyVal=e.altKey;oEvent.metaKeyVal=e.metaKey;oEvent.ctrlKeyVal=e.ctrlKey;var _elem=target?target:_getElementKeyboardDown(this.nativeFocusElement,3);_elem.dispatchEvent(oEvent);return oEvent.defaultPrevented},isSpaceSymbol:function(e){if(e.keyCode==32)return true;if(e.keyCode==229&&(e.code=="space"||e.code=="Space"||e.key=="Spacebar"))return true;return false},systemInputEnable:function(isEnabled){if(this.isSystem==isEnabled)return;
this.isSystem=isEnabled;this.HtmlArea.style.left=this.isSystem?"0px":"-"+(this.HtmlAreaWidth>>1)+"px";this.clear();if(this.isShow)this.unshow(true);if(this.Api.WordControl&&this.Api.WordControl.m_oLogicDocument&&this.Api.WordControl.m_oLogicDocument.Document_UpdateSelectionState)this.Api.WordControl.m_oLogicDocument.Document_UpdateSelectionState()},debugInputEnable:function(isEnabled){if(this.isDebug==isEnabled)return;this.isDebug=isEnabled;this.HtmlArea.style.left=this.isDebug?"0px":"-"+(this.HtmlAreaWidth>>
1)+"px"},apiInputText:function(codes){var isAsync=AscFonts.FontPickerByCharacter.checkTextLight(codes,true);if(!isAsync){this.apiCompositeStart();this.apiCompositeReplace(codes);this.apiCompositeEnd()}else{AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.apiCompositeStart();this.apiCompositeReplace(codes);this.apiCompositeEnd();this.setReadOnly(false)});this.setReadOnly(true);return false}},onKeyDown:function(e){if(this.Api.isLongAction()){AscCommon.stopEvent(e);return false}if(this.isInputHelpersPresent)switch(e.keyCode){case 9:case 13:case 38:case 40:case 33:case 34:case 35:case 36:case 27:{window.g_asc_plugins.onPluginEvent2("onKeyDown",
{"keyCode":e.keyCode},this.isInputHelpers);AscCommon.stopEvent(e);return false}case 32:{if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperInput",{"text":this.keyPressInput})}default:break}else if(32==e.keyCode);if(this.isSystem&&this.isShow){if(e.keyCode==13){var text=this.getAreaValue();var codes=[];for(var iter=text.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());this.apiInputText(codes);this.clear();this.unshow();AscCommon.stopEvent(e);return false}else if(e.keyCode==
27){this.clear();this.unshow();AscCommon.stopEvent(e);return false}return}if(null!=this.nativeFocusElement)if(this.emulateNativeKeyDown(e)){e.preventDefault();return false}var _code=e.keyCode;if(_code!=8&&_code!=46)this.KeyDownFlag=true;AscCommon.check_KeyboardEvent(e);var arrCodes=this.Api.getAddedTextOnKeyDown(AscCommon.global_keyboardEvent);var isAsync=AscFonts.FontPickerByCharacter.checkTextLight(arrCodes,true);if(isAsync){AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.onKeyDown(e);
this.onKeyUp(e);this.setReadOnly(false)});AscCommon.stopEvent(e);this.setReadOnly(true);return false}var ret=this.Api.onKeyDown(e);switch(e.keyCode){case 8:{var oldKeyPressInput=this.keyPressInput;this.clear();if(oldKeyPressInput.length>1){this.keyPressInput=oldKeyPressInput.substr(0,oldKeyPressInput.length-1);if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperInput",{"text":this.keyPressInput})}return false}case 9:case 13:case 37:case 38:case 39:case 40:case 33:case 34:case 35:case 36:{this.clear();
return false}case 46:case 45:{if(!AscCommon.global_keyboardEvent.CtrlKey&&!AscCommon.global_keyboardEvent.ShiftKey){this.clear();return false}}default:break}if(e.keyCode==32&&AscCommon.global_keyboardEvent.CtrlKey&&!AscCommon.global_keyboardEvent.ShiftKey)if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onClick");return ret},onKeyPress:function(e){if(this.Api.isLongAction()||!this.Api.asc_IsFocus()||this.Api.isViewMode){AscCommon.stopEvent(e);return false}if(this.isSystem)return;if(this.KeyDownFlag)this.KeyPressFlag=
true;if(this.IsComposition)return;if(e.which==13&&e.keyCode==13||e.which==10&&e.keyCode==10){AscCommon.stopEvent(e);return false}var c=e.which||e.keyCode;var isAsync=c>=32?AscFonts.FontPickerByCharacter.checkTextLight([c],true):false;if(isAsync){AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.apiCompositeStart();this.apiCompositeReplace([c]);this.apiCompositeEnd();this.setReadOnly(false)});AscCommon.stopEvent(e);this.setReadOnly(true);return false}if(this.isKeyPressOnUp){var isSaveCode=
true;switch(e.which){case 46:{isSaveCode=false;break}default:break}if(isSaveCode){if(this.isKeyPressOnUpStackedMode)this.keyPressOnUpCodes.push({which:e.which,charCode:e.charCode,keyCode:e.keyCode,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,preventDefault:function(){}});return}}var ret=this.Api.onKeyPress(e);switch(e.which){case 46:{AscCommon.stopEvent(e);this.clear();return false}default:break}this.keyPressInput+=String.fromCharCode(e.which);if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperInput",

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 150 KiB

@ -1,5 +1,5 @@
/*
* Copyright (C) Ascensio System SIA 2012-2021. All rights reserved
* Copyright (C) Ascensio System SIA 2012-2022. All rights reserved
*
* https://www.onlyoffice.com/
*

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

Loading…
Cancel
Save