Merge branch 'testtheme' into exportSheet

This commit is contained in:
yflory 2021-10-04 12:50:05 +02:00
commit 07b31dc84d
98 changed files with 3985 additions and 1405 deletions

View File

@ -1,54 +1,150 @@
# 4.11.0 (WIP)
## Goals
## Update notes
* warning about lack of support for internet explorer
* existing support will get worse over time. please update.
* we only support IE for the home page and related info pages. Apps with complex functionality assume you are using a regularly updated browser.
* this release includes new clientside dependencies. Don't forget to run `bower update`
To update from 4.10.0 to 4.11.0:
1. Stop your server
2. Get the latest code with git
3. Install the latest dependencies with `bower update` and `npm i`
4. Restart your server
5. Confirm that your instance is passing all the tests included on the `/checkup/` page (on whatever devices you intend to support)
## Features
* unify unregistered/non-registered/anonymous terminology as 'guest'
* support
* prompt users that need support to subscribe
* refactor debugging data generation to easily show users what data is included
* form improvements
* include bar graphs for multiple-answer form questions
* move the tally of empty responses to the top of each question's summary (rather than the bottom)
* conditionally displayed sections depending on the state of previous answers
* nicer participant view without CryptPad toolbar or popups
* response page to with customizable message to thank those that have responded
* more granular form controls and clearer text
* anonymization settings for answers
* optional restriction of a form to registered users only
* real-time form authorship.
* changes are saved as you type, so you no longer need to "save" each question.
* co-author surveys with other users and edit the same question concurrently.
* avoid redrawing active parts of the UI when other authors make a change (datepicker UI, dropdowns, etc.)
* redraw no more than once every 500ms for performance reasons
* preserve current scroll position when other users make changes
* easier access to basic for form authors in the left sidebar:
* preview a form
* copy the participant link
* view existing responses
* more intuitive display of answers
* bar charts throughout, wherever applicable
* options with no answers are still displayed with zero results in the summary rather than not being displayed at all
* options are displayed according to the order of their appearance in the original question, rather than according to the order in which participants chose them
* the number of empty answers is displayed above the scrollable section of each answer's summary rather than at the bottom
* more intuitive controls and default options
* placeholders for text inputs instead of pre-filled fields
* "enter" creates a new field
* "esc" clears an empty field
* easy navigation using the tab key
* convert between related question types:
* radio, checkbox, ranked choices
* multi-radio, multi-check
* more form validation options:
* required questions
* validated question types
* summarize invalid answers at the bottom of the form. jump to the relevant question when clicked.
* CryptPad logo displayed at the bottom of the participant page which links to the home page
* we've pre-filled some options in our "simple scheduling poll" template.
* bar charts on the admin page's 'Performance' tab
* enhancements for guest users and registered users without names or avatars
* two initials for users with a custom name but no avatar (previously one initial, always capitalized)
* animal avatars as defaults instead of indistinguishable initials (A for Anonymous, G for Guest)
* configurable via `AppConfig.emojiAvatars = []`
* authorship data for guests in rich text comments, code editor author data
* emojis in cursor tooltips for guests (rich text, code, slide, kanban)
* emojis in the share and access modals for contacts with empty names
* script to identify unnecessary duplication of translations
* improvements to upload and media-tag UI
* support for adding descriptive text at upload time
* preview of uploaded media in the upload modal
* our link creation UI from 4.9.0 now highlights the URL input field as you type to indicate whether the current URL value is valid
* the share menu now makes its primary actions more clear, with explicit text ("copy link" instead of just "copy") on its main buttons, as well as icons that better match button UI on the rest of the platform.
* we're working towards better accessibility for screen readers with better alt-text and `aria-` attributes to suppress descriptions of strictly visual UI features.
## Bug fixes
* fix empty name fields in various places across the platform where we did not fall back to "anonymous/guest"
* teams
* contacts
* ???
* clarified a comment in the nginx config about _professional support_
* handled an edge case in ICS import to calendars where DTEND was not defined (use duration or consider it an "all-day" event
* links shared by contacts could be previewed in a modal when viewing their notification. The color of the previewed link was overridden by some bootstrap styles. we now use a better color.
* better validation for team invite links where badly formed invite content could have triggered a type error.
# 4.10.0
## Goals
August is typically a quiet month for CryptPad's development team, as members of our team and many of our users take their (northern hemisphere) summer holidays. We took the opportunity to catch up on some regular maintentance and to review and some prototype branches of our code that had been ready for integration for some time.
It seems that some browser developers thought to do the same thing, because we noticed some significant regressions in some APIs that we rely on. Some of our time went towards addressing the resulting bugs and restructuring some code to avoid future regressions for browser behaviour that seem likely to be changed again in the near future.
## Update notes
4.10.0 includes some minor changes to [the checkup page](https://docs.cryptpad.fr/fr/admin_guide/installation.html#diagnostics). Some admins have included screenshots of this page in bug reports or requests for support along with details of problems they suspect of being related. Because we've observed that the root of many issues is the browser (sometimes in addition to the server) we have decided to include details about the browser in this page's summary.
Up until now the checkup page only tested observable behaviour of the server such as HTTP headers on particular resources, configuration parameters distributed to the client, and the availability of essential resources. This practice meant that a report for an instance should have been the same regardless of the device that was used to generate the report. In light of a serious regression in Chrome (and all its derivatives) we decided that objectiveness was less important than utility and introduced some tests which check whether the client running the diagnostics interprets the provided server configuration. Terrible browsers (ie. every browser that is available on iOS) will fail these tests every time because they don't implement the expected APIs, but we've tried to detect these cases and warn that they are expected.
For the most part you (as an admin) will not need to do anything special for this release as a result. If you notice weird issues on particular browsers in the future, however, it might be helpful to view this page from the affected browser/device and include any information that is provided in bug reports.
To update from 4.9.0 to 4.10.0:
1. Stop your server
2. Get the latest code with git
3. Install the latest dependencies with `bower update` and `npm i`
4. Restart your server
5. Confirm that your instance is passing all the tests included on the `/checkup/` page (on whatever devices you intend to support)
## Features
* screen real-estate
* kanban
* narrower 'add board' button
* 'Tools' menu to collapse the tag and view mode UI
* general
* main toolbar collapse
* remove unused files
* /common/noscriptfix.js
* more detailed inventory of dependencies
* see cryptpad/www/lib/changelog.md
* include vendor and appVersion in support ticket data
* log when trimming history
* rewrite some translation keys to use a single syntax for BR tags
* translations
* more linting
* standardized capitalization of "CryptPad"
* avoid raw injection of HTML strictly for adding line breaks
* remove some unnecessary cases of raw HTML injection
* checkup
* better styles
* improved formatting for returned values in failed tests
* display browser and OS for when people send us screenshots instead of URLs
* test for support of some features in the browser (inside the sandbox)
* mark password inputs as _new passwords_ so that browsers don't suggest you input and share your account password
As noted above, web standards and the browsers that implement them are constantly changing. Web applications like CryptPad which use new and advanced browser features are particularly prone to regressions even when we use browser features exactly as intended and advertized. The "Features" section of each release's notes typically highlights visible things, like clickable buttons or improvements to the interface. This point is included as a reminder that _regular maintenance is at least as important to an open-source software project_, even though it gets little attention and far less funding. The funding bodies that have generously supported our work typically award grants for research and the development of novel features, but we are sorely in need of increased support to allow us the flexibility to deal with unanticipated problems as they arise. If you are fortunate enough to have some disposable income and value the work that keeps CryptPad functional we would greatly appreciate a one-time or recurring donation to [our OpenCollative campaign](https://opencollective.com/cryptpad/contribute).
* This release coincided the yearly seminar of [XWiki (our parent organization)](https://www.xwiki.com) which always features a day-long hackathon. This year our team was joined by [@aemi-dev](https://github.com/aemi-dev) who has been working as an intern within XWiki's product team. Together we worked on adding some data visualization to our recently introduced _Form_ app. The improvements include a timeline to visualize how many responses were submitted to the form during each day and bar charts for a variety of question types to complement the existing tally of results. There's still more work to be done in this direction, but we established some useful foundations during our relatively short session.
* Frequent users of small screens will be pleased to hear that CryptPad's app toolbar now includes a button to collapse the upper segment of the toolbar which includes CryptPad's logo, the current document's title, status indicator (saved, editing, disconnected, etc.), and the user administration menu.
* Likewise, Kanban users may note that the app's toolbar also features a "Tools" menu (like that in the markdown editor) which toggles display of the controls which filter board items by tag and select view state (detailed or brief).
* Password fields that are specific to files and documents now have the `autocomplete="new-password"` attribute applied to prevent browsers and integrated password managers from suggesting that users enter their account password. This lowers the risk that users will inadvertently reveal their account password in the future. Additionally, Firefox will now prompt users to use a high-entropy password instead.
* Our integrated support ticket functionality automatically includes some commonly needed information about the user's account and browser. As of this release this data will also include the browser's `vendor` and `appVersion`, which are useful hints about the host browser and OS (which we almost always have to ask about when the ticket is for a bug report). This data will also include the browser's current width and height, as some issues only occur at particular resolutions and can otherwise be difficult to reproduce.
* We reviewed a range of third-party dependencies that are included in our repository and updated `cryptpad/www/lib/changelog.md` to better indicate their exact version, source, and any CryptPad-specific modifications we've made to them.
* We found `less.js` had been duplicated, with one version (provided by bower) being used for custom styles in our slide editor while the rest of the platform used a custom version that fixed an apparent bug in the _reference import_ syntax. We've standardized on our custom version and removed the alternative from our `bower.json` file.
* We also identified a few files that were no longer in use and removed them. There's still more work to be done to document the exact versions and source of some dependencies, so we've made this process a part of our regular release checklist.
* During a manual review we noticed some inconsistencies between different translations of CryptPad and have automated these checks by adding them to a script which we use to review translations before each release. These have helped us standardize things like the capitalization of "CryptPad", the syntax for some basic markup like `<br>` tags, and the consistent use of both dialect-specific suffixes in English and punctuation rules in French. We have only added tests for languages in which members of our team are fluent, so if you maintain a translation in another language and can suggest additional qualities we could test we would welcome your suggestions.
* The improved consistency of our translations has also enabled us to construct some translated UI components programmatically without directly using their inline HTML. This provides an extra layer of security in the event that
1. malicious code was included in a translation file
2. our tests failed to identify the code before it was included in a release
3. the release was deployed by an admin that had failed to take advantage of the sandboxing system that prevents the injection of scripts into the UI
## Bug fixes
* Sheet export
* most exports broken by Chrome 92, mostly fixed
* we discovered that CSV export was not working in any major browser, though it's unclear why. We've disabled CSV export in the meantime
* updated translation to stop referring to Microsoft since we support OpenDocument formats
* some new browser-specific checkup tests to make it easier to detect future regressions in the APIs
* drive bug fixes
* guard against a few possible type errors
* "burn this drive" button works again in Firefox
* clear login token
1. when you delete your account
2. when logging in
* use single version of less.js on the client
* abort subsequent actions when metadata fails to load during owned channel archival
* handle warnings when trimming history (not just errors)
* filter channel ids with invalid lengths when generating a list of all channels you use
* The Chrome development team made some changes related to the availability of the `SharedArrayBuffer` API in cross-site-isolated contexts such as that of our sandboxing system which resulted in it being disabled despite the fact that our usage conformed to a specification that should have been supported. We use this modern browser feature (where available) to convert spreadsheets between different formats in the browser itself, whereas other services (even those advertizing their use of encryption for documents) send users' content to their server for conversion. Since Chrome's engine is used as the basis for a wide variety of other browsers, this broke sheet export everywhere except Firefox (which correctly implements the specification). Luckily, we found a simple workaround to use the same underlying feature using an alternate syntax that they had failed to disable. This is only a short-term solution as we have no expectation that it will continue to work, so we are actively investigating making this conversion a trusted process that will be run outside of our sandboxing system.
* On the topic of spreadsheet conversion, we updated our translations of the warning that is displayed in our conversion UI when the required browser features are not available. Rather than referring to "Microsoft Office formats" we now refer to _"Office formats"_ since we offer support for ODS in addition to XLSX.
* We found that CSV export mysteriously stopped working as well (seemingly everywhere, not just Chrome and derivatives). We're still not sure why this is the case, but the option is disabled in the UI until we can find and fix the problem.
* The _drive_ app includes a button that lets guest users wipe their personal data from their browser's session. We noticed that this button did nothing after approximately 50% of page loads in Firefox, suggesting there was an unpredictable quality related to either how the button was being created or how "click handlers" were declared. We traced it back to the jQuery library and rewrote the handler to use "VanillaJS". We don't have the time or budget to dig into why it stopped working, so unless someone else can figure it out for us then you, dear reader, may never learn the answer to this mystery.
* While investigating the drive we also added some guards against some possible type errors.
* We noticed that the `loginToken` attribute was not correctly removed from clients' localStorage when they deleted their account. The value of this token is random and is of no use to attackers (especially when the token belongs to a deleted account), but it was a cause of some inconvenience to us when testing account deletion, as the mismatch between the token stored locally and in accounts (after login) required us to login in a second time before. We've updated the related code to:
1. correctly delete the token when you delete an account from the settings page
2. ensure that no such token is present when logging in
* Document ids with invalid lengths are excluded from accounts' lists of "pinned documents" (those which should not be deleted from the server). We recently implemented a similar fix, but found that this list could be constructed in more than one way depending on the context.
* We identified and fixed two problems with our "history trim" functionality (accessible via documents' "Properties" menu):
1. In the extremely unlikely event that a user requested that the server trim the history of a document and its metadata failed to load, the server would respond to the user with an error but did not correctly abort from the subsequent process to trim the document's history. In theory this could have been used by non-owners to archive parts of the documents history, however, we have no reason to believe that this was possible in practice. In any case, the flaw has been corrected.
2. Complex documents like spreadsheets that use more than one channel to store different types of content would trim their respective histories in parallel, however, in such cases any errors were returned to the calling function as a list of warnings rather than a singular error. This format was not handled by the UI, resulting in an apparent success in cases of a partial or complete failure for such document types.
# 4.9.0

View File

@ -30,7 +30,7 @@
"secure-fabric.js": "secure-v1.7.9",
"hyperjson": "~1.4.0",
"chainpad-crypto": "^0.2.0",
"chainpad-listmap": "^0.10.0",
"chainpad-listmap": "^1.0.0",
"chainpad": "^5.2.0",
"file-saver": "1.3.1",
"alertifyjs": "1.0.11",

Binary file not shown.

View File

@ -7,28 +7,28 @@
<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="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="&#xe901;" 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="&#xe902;" 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" />
<glyph unicode="&#xe903;" glyph-name="shared-folder" d="M829.44 727.251h-296.84l-47.104 62.886c-25.923 34.066-66.406 55.898-111.999 56.139h-178.938c-77.457-0.137-140.211-62.891-140.348-140.335v-515.868c0.137-77.457 62.891-140.211 140.335-140.348h634.893c77.457 0.137 140.211 62.891 140.348 140.335v396.482c0 0.036 0 0.078 0 0.121 0 77.561-62.807 140.452-140.335 140.589h-0.013zM911.119 190.072c-0.068-45.083-36.597-81.611-81.673-81.679h-634.887c-45.083 0.068-81.611 36.597-81.679 81.673v515.862c0.068 45.083 36.597 81.611 81.673 81.679h178.906c26.48-0.030 50.004-12.656 64.908-32.207l0.146-0.199 47.104-62.765 17.709-24.094h326.114c45.125-0.069 81.679-36.665 81.679-81.799 0 0 0 0 0 0v0zM614.4 451.132c0.071 0 0.156 0 0.24 0 34.132 0 61.801 27.669 61.801 61.801s-27.669 61.801-61.801 61.801c-34.047 0-61.664-27.532-61.801-61.547v-0.013c0-0.018 0-0.040 0-0.061 0-7.309 1.235-14.33 3.508-20.865l-0.135 0.446-103.966-60.235c-0.474 0.655-1.031 1.213-1.665 1.672l-0.021 0.015c-10.785 9.46-25.010 15.231-40.582 15.231-34.065 0-61.681-27.615-61.681-61.681 0-11.035 2.898-21.393 7.974-30.355l-0.16 0.307c11.046-18 30.619-29.824 52.953-29.824 16.92 0 32.255 6.786 43.431 17.785l-0.008-0.008 103.966-60.235c-2.138-5.921-3.374-12.754-3.374-19.876 0-0.085 0-0.171 0.001-0.256v0.013c-0.003-0.217-0.005-0.474-0.005-0.731 0-7.409 1.417-14.486 3.994-20.977l-0.135 0.384c8.944-23.66 31.407-40.178 57.728-40.178 33.999 0 61.56 27.562 61.56 61.56 0 28.833-19.822 53.036-46.582 59.725l-0.424 0.090c-4.366 1.539-9.418 2.572-14.664 2.884l-0.154 0.007c-19.639 0-37.082-9.398-48.078-23.943l-0.11-0.152-101.798 59.031c3.729 7.764 5.908 16.879 5.908 26.504s-2.179 18.74-6.070 26.88l0.162-0.376 101.798 58.79c11.336-14.332 28.681-23.481 48.167-23.612h0.022z" />
<glyph unicode="&#xe904;" glyph-name="file-upload" 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.905zM438.857 487.905c-8.019 0-15.814-3.102-21.238-8.762l-153.524-153.524c-5.66-5.66-8.952-13.457-8.952-21.476s3.292-15.53 8.952-21.19l17.667-17.714c5.424-5.66 13.219-8.952 21.238-8.952s15.814 3.292 21.238 8.952l69.333 69.095v-166c0-16.981 14.153-27.619 30.19-27.619h30.19c16.038 0 30.19 10.638 30.19 27.619v166l69.333-69.095c5.424-5.66 13.219-8.952 21.238-8.952s15.816 3.292 21.476 8.952l17.667 17.714c5.425 5.66 8.714 13.172 8.714 21.19s-3.29 15.816-8.714 21.476l-153.524 153.524c-5.66 5.66-13.457 8.762-21.476 8.762z" />
<glyph unicode="&#xe905;" glyph-name="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.905zM535.524 513.905c-63.766 0-115.619-51.901-115.619-115.667s51.854-115.619 115.619-115.619c48.792 0 92.974 31.714 109.238 77.667 2.84 8.261 5.905 18.862 5.905 27.381 0 5.163-3.075 9.048-8.238 9.048s-65.052-37.714-73.571-42.619l-49.857 27.619v57.857l75.667 43.619c2.323 1.549 4.143 4.398 4.143 7.238 0 3.098-1.562 5.431-4.143 7.238-15.748 10.585-40.297 16.238-59.143 16.238zM412.667 349.714l-175.81-175.81c-6.196-6.196-9.81-14.699-9.81-23.476s3.614-17.3 9.81-23.238l27.333-27.905c6.196-5.938 14.746-9.524 23.524-9.524s17.3 3.586 23.238 9.524l176.048 176.095c-33.819 13.424-60.909 40.514-74.333 74.333zM304.238 183.476c9.036 0 16.524-7.488 16.524-16.524s-7.488-16.524-16.524-16.524c-9.036 0-16.524 7.488-16.524 16.524s7.488 16.524 16.524 16.524z" />
<glyph unicode="&#xe906;" glyph-name="poll" 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.905zM569.762 482.524v-349.238h162.714v349.238h-162.714zM358.238 385.476v-252.19h162.714v252.19h-162.714zM146.667 277.381v-144.095h162.762v144.095h-162.762z" />
<glyph unicode="&#xe907;" glyph-name="slide" 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.905zM142.286 550.714v-255.238h133.19v-109.762h133.143v-109.81h326.809v255.381h-133.143v109.81h-133.143v109.619h-326.857zM191.048 501.905h229.286v-60.81h-144.857v-96.81h-84.429v157.619zM324.238 392.333h229.286v-61.048h-144.905v-96.81h-84.381v157.857zM457.381 282.524h229.286v-157.81h-229.286v157.81z" />
<glyph unicode="&#xe908;" glyph-name="sheet" 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.905zM141.286 532.571v-463.81h598.429v463.81h-598.429zM190.048 483.762h134.429v-158.714h-134.429v158.714zM373.286 483.762h134.429v-158.714h-134.429v158.714zM556.524 483.762h134.429v-158.714h-134.429v158.714zM190.048 276.286h134.429v-158.762h-134.429v158.762zM373.286 276.286h134.429v-158.762h-134.429v158.762zM556.524 276.286h134.429v-158.762h-134.429v158.762z" />
<glyph unicode="&#xe909;" glyph-name="folder-open" d="M100.232 590.035h828.717c-5.175 69.899-63.091 124.668-133.829 124.808h-283.843l-44.936 60.235c-24.766 32.712-63.599 53.649-107.326 53.73h-170.599c-0.036 0-0.078 0-0.121 0-73.968 0-133.946-59.894-134.084-133.83v-213.366l10.12 76.74c2.295 17.95 17.476 31.684 35.865 31.684 0.012 0 0.025 0 0.037 0h-0.002zM929.19 541.606h-805.948c-13.269-0.004-24.238-9.848-26.006-22.632l-0.016-0.137-43.008-317.801c-0.002-0.261-0.003-0.569-0.003-0.877 0-6.111 0.483-12.11 1.413-17.96l-0.085 0.646c0.904-6.888 2.169-12.966 3.837-18.875l-0.223 0.925c16.563-56.812 68.138-97.63 129.257-97.702h606.698c61.093 0.086 112.628 40.906 128.907 96.752l0.237 0.95c1.459 5.065 2.725 11.228 3.544 17.531l0.070 0.66c0.844 5.201 1.327 11.196 1.327 17.304 0 0.227-0.001 0.454-0.002 0.681v-0.035l40.237 295.755c0.219 1.556 0.344 3.354 0.344 5.18 0 21.624-17.529 39.153-39.153 39.153-0.036 0-0.073 0-0.109 0h0.006z" />
<glyph unicode="&#xe90a;" glyph-name="kanban" 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.905zM146.667 493.81v-90.143h162.762v90.143h-162.762zM358.238 493.81v-90.143h162.714v90.143h-162.714zM569.762 493.81v-90.143h162.714v90.143h-162.714zM146.667 358.619v-90.143h162.762v90.143h-162.762zM569.762 358.619v-90.143h162.714v90.143h-162.714zM146.667 223.429v-90.143h162.762v90.143h-162.762z" />
<glyph unicode="&#xe90b;" glyph-name="folder" d="M373.459 846.276h-178.899c-77.457-0.137-140.211-62.891-140.348-140.335v-515.868c0.137-77.457 62.891-140.211 140.335-140.348h634.893c77.457 0.137 140.211 62.891 140.348 140.335v396.482c0 0.036 0 0.078 0 0.121 0 77.561-62.807 140.452-140.335 140.589h-296.853l-47.104 62.886c-25.923 34.066-66.406 55.898-111.999 56.139h-0.039z" />
<glyph unicode="&#xe90c;" glyph-name="shared-folder-open" d="M98.424 593.288h797.274c-4.8 67.457-60.657 120.376-128.894 120.471h-272.876l-43.249 57.705c-23.816 31.47-61.17 51.611-103.232 51.682h-164.213c-0.036 0-0.079 0-0.121 0-71.191 0-128.904-57.712-128.904-128.904 0-0.17 0-0.339 0.001-0.508v0.026-204.8l9.638 73.487c2.062 17.437 16.753 30.833 34.574 30.84h0.001zM900.759 255.608l33.973 248.049c0.196 1.447 0.308 3.12 0.308 4.819 0 20.873-16.906 37.797-37.772 37.828h-776.797c-12.746-0.016-23.272-9.5-24.923-21.796l-0.014-0.129-41.321-304.791c-0.002-0.25-0.003-0.546-0.003-0.843 0-5.87 0.483-11.628 1.412-17.235l-0.083 0.609c0.793-6.689 1.977-12.655 3.576-18.449l-0.203 0.861c15.92-54.648 65.53-93.912 124.319-93.967h583.566c0.061 0 0.133 0 0.205 0 16.48 0 32.227 3.14 46.675 8.853l-0.86-0.3c16.639-15.985 39.283-25.829 64.225-25.829 51.231 0 92.762 41.531 92.762 92.762 0 42.798-28.984 78.827-68.394 89.528l-0.65 0.15zM766.795 148.51h-583.56c-32.265 0.073-59.5 21.523-68.297 50.935l-0.13 0.506c-0.742 2.66-1.376 5.889-1.775 9.19l-0.032 0.327v1.566c0 1.566 0 3.373 0 5.301l36.382 272.023h724.751l-32.407-236.845c-1.82-0.63-3.331-1.281-4.788-2.025l0.21 0.097c-16.682-8.067-30.192-20.454-39.403-35.727l-0.232-0.415c-1.574-2.381-3.028-5.115-4.218-7.987l-0.119-0.325c-5.551-11.368-8.797-24.735-8.797-38.86 0-0.23 0.001-0.46 0.003-0.689v0.035c0-0.017 0-0.037 0-0.057 0-5.166 0.394-10.241 1.154-15.195l-0.070 0.554c-5.405-1.532-11.612-2.412-18.026-2.412-0.228 0-0.455 0.001-0.682 0.003h0.035zM877.026 84.781c-20.129 0.108-38.483 7.622-52.493 19.954l0.089-0.077c-14.994 12.543-25.212 30.362-27.788 50.568l-0.041 0.392c-0.537 3.145-0.844 6.769-0.844 10.463 0 0.091 0 0.182 0.001 0.273v-0.014c-0.001 0.109-0.001 0.239-0.001 0.368 0 12.484 2.89 24.293 8.038 34.794l-0.207-0.466c1.278 2.771 2.523 5.062 3.896 7.265l-0.161-0.278c7.898 12.884 18.884 23.175 31.958 30.024l0.449 0.214c0.692 0.493 1.491 0.902 2.346 1.186l0.064 0.018c10.065 4.991 21.914 7.922 34.445 7.951h0.010c0.046 0 0.1 0 0.154 0 7.802 0 15.336-1.144 22.444-3.275l-0.553 0.142c35.119-9.412 60.555-40.954 60.555-78.437 0-44.777-36.299-81.077-81.077-81.077-0.451 0-0.902 0.004-1.351 0.011l0.068-0.001zM906.059 183.206c9.581 0 17.348 7.767 17.348 17.348s-7.767 17.348-17.348 17.348v0c-0.002 0-0.004 0-0.007 0-9.411 0-17.072-7.495-17.341-16.841l-0.001-0.025c-0.004-0.12-0.006-0.262-0.006-0.404 0-1.849 0.356-3.615 1.003-5.232l-0.034 0.095-29.274-16.986c-3.089 3.105-7.328 5.063-12.025 5.18h-0.022c-9.003-0.772-16.019-8.271-16.019-17.408s7.015-16.636 15.954-17.404l0.065-0.004c4.719 0.117 8.958 2.075 12.046 5.179l0.001 0.001 12.047-7.228 16.504-9.638c-0.536-1.568-0.846-3.375-0.846-5.255 0-0.101 0.001-0.202 0.003-0.302v0.015c0-9.581 7.767-17.348 17.348-17.348s17.348 7.767 17.348 17.348c0 9.581-7.767 17.348-17.348 17.348v0c-5.563-0.038-10.508-2.653-13.705-6.709l-0.028-0.037-16.143 9.397-12.047 7.228c1.007 2.155 1.621 4.672 1.686 7.326v0.023c-0.052 2.758-0.667 5.36-1.736 7.712l0.050-0.122 28.672 16.625c3.116-4.367 8.151-7.19 13.848-7.228h0.006z" />
<glyph unicode="&#xe90d;" glyph-name="code" horiz-adv-x="878" d="M827.746 734.667l-173.333 173.333c-20.556 20.556-61.667 37.778-91.111 37.778h-497.778c-29.444 0-53.333-23.889-53.333-53.333v-888.889c0-29.444 23.889-53.333 53.333-53.333h746.667c29.444 0 53.333 23.889 53.333 53.333v640c0 29.444-17.222 70.556-37.778 91.111zM581.079 870.222c9.444-3.333 18.889-8.333 22.778-12.222l173.889-173.889c3.889-3.889 8.889-13.333 12.222-22.778h-208.889zM794.413 21.333h-711.111v853.333h426.667v-231.111c0-29.444 23.889-53.333 53.333-53.333h231.111zM278.857 519.111l-125.556-167.222c-4.444-6.111-4.444-15 0-21.111l125.556-167.222c6.111-7.778 17.222-9.444 25-3.333l28.333 21.111c7.778 6.111 9.444 17.222 3.333 25l-101.111 135 101.111 135c6.111 7.778 4.444 18.889-3.333 25l-28.333 21.111c-7.777 6.111-18.889 4.444-25-3.333zM724.413 351.889l-125.556 167.222c-6.111 7.778-17.222 9.444-25 3.333l-28.333-21.111c-7.777-6.111-9.444-17.222-3.333-25l101.111-135-101.111-135c-6.111-7.778-4.444-18.889 3.333-25l28.333-21.111c7.778-6.111 18.889-4.444 25 3.333l125.556 167.222c4.444 6.111 4.444 15 0 21.111zM379.968 95.778l35-5.556c9.444-1.667 18.889 4.444 20.556 14.444l76.667 461.667c1.667 9.444-4.444 18.889-14.444 20.556l-35 5.556c-9.444 1.667-18.889-4.444-20.556-14.444l-76.667-461.667c-1.667-9.444 4.444-18.889 14.444-20.556z" />
<glyph unicode="&#xe90e;" glyph-name="richtext" horiz-adv-x="878" d="M827.746 734.667l-173.333 173.333c-20.556 20.556-61.667 37.778-91.111 37.778h-497.778c-29.444 0-53.333-23.889-53.333-53.333v-888.889c0-29.444 23.889-53.333 53.333-53.333h746.667c29.444 0 53.333 23.889 53.333 53.333v640c0 29.444-17.222 70.556-37.778 91.111zM581.079 870.222c9.444-3.333 18.889-8.333 22.778-12.222l173.889-173.889c3.889-3.889 8.889-13.333 12.222-22.778h-208.889zM794.413 21.333h-711.111v853.333h426.667v-231.111c0-29.444 23.889-53.333 53.333-53.333h231.111zM225.524 501.333v-35.556c0-10 7.778-17.778 17.778-17.778h391.111c10 0 17.778 7.778 17.778 17.778v35.556c0 10-7.778 17.778-17.778 17.778h-391.111c-10 0-17.778-7.778-17.778-17.778zM634.413 376.889h-391.111c-10 0-17.778-7.778-17.778-17.778v-35.556c0-10 7.778-17.778 17.778-17.778h391.111c10 0 17.778 7.778 17.778 17.778v35.556c0 10-7.778 17.778-17.778 17.778zM634.413 234.667h-391.111c-10 0-17.778-7.778-17.778-17.778v-35.556c0-10 7.778-17.778 17.778-17.778h391.111c10 0 17.778 7.778 17.778 17.778v35.556c0 10-7.778 17.778-17.778 17.778z" />
<glyph unicode="&#xe90f;" glyph-name="file" horiz-adv-x="878" d="M827.745 734.666l-173.333 173.333c-20.556 20.556-61.667 37.778-91.111 37.778h-497.777c-29.444 0-53.333-23.889-53.333-53.333v-888.887c0-29.444 23.889-53.333 53.333-53.333h746.665c29.444 0 53.333 23.889 53.333 53.333v639.999c0 29.444-17.222 70.555-37.778 91.111zM581.079 870.221c9.444-3.333 18.889-8.333 22.778-12.222l173.889-173.889c3.889-3.889 8.889-13.333 12.222-22.778h-208.889zM794.412 21.334h-711.11v853.332h426.666v-231.111c0-29.444 23.889-53.333 53.333-53.333h231.111z" />
<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="&#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" />
<glyph unicode="&#xe904;" glyph-name="shared-folder" d="M829.44 727.251h-296.84l-47.104 62.886c-25.923 34.066-66.406 55.898-111.999 56.139h-178.938c-77.457-0.137-140.211-62.891-140.348-140.335v-515.868c0.137-77.457 62.891-140.211 140.335-140.348h634.893c77.457 0.137 140.211 62.891 140.348 140.335v396.482c0 0.036 0 0.078 0 0.121 0 77.561-62.807 140.452-140.335 140.589h-0.013zM911.119 190.072c-0.068-45.083-36.597-81.611-81.673-81.679h-634.887c-45.083 0.068-81.611 36.597-81.679 81.673v515.862c0.068 45.083 36.597 81.611 81.673 81.679h178.906c26.48-0.030 50.004-12.656 64.908-32.207l0.146-0.199 47.104-62.765 17.709-24.094h326.114c45.125-0.069 81.679-36.665 81.679-81.799 0 0 0 0 0 0v0zM614.4 451.132c0.071 0 0.156 0 0.24 0 34.132 0 61.801 27.669 61.801 61.801s-27.669 61.801-61.801 61.801c-34.047 0-61.664-27.532-61.801-61.547v-0.013c0-0.018 0-0.040 0-0.061 0-7.309 1.235-14.33 3.508-20.865l-0.135 0.446-103.966-60.235c-0.474 0.655-1.031 1.213-1.665 1.672l-0.021 0.015c-10.785 9.46-25.010 15.231-40.582 15.231-34.065 0-61.681-27.615-61.681-61.681 0-11.035 2.898-21.393 7.974-30.355l-0.16 0.307c11.046-18 30.619-29.824 52.953-29.824 16.92 0 32.255 6.786 43.431 17.785l-0.008-0.008 103.966-60.235c-2.138-5.921-3.374-12.754-3.374-19.876 0-0.085 0-0.171 0.001-0.256v0.013c-0.003-0.217-0.005-0.474-0.005-0.731 0-7.409 1.417-14.486 3.994-20.977l-0.135 0.384c8.944-23.66 31.407-40.178 57.728-40.178 33.999 0 61.56 27.562 61.56 61.56 0 28.833-19.822 53.036-46.582 59.725l-0.424 0.090c-4.366 1.539-9.418 2.572-14.664 2.884l-0.154 0.007c-19.639 0-37.082-9.398-48.078-23.943l-0.11-0.152-101.798 59.031c3.729 7.764 5.908 16.879 5.908 26.504s-2.179 18.74-6.070 26.88l0.162-0.376 101.798 58.79c11.336-14.332 28.681-23.481 48.167-23.612h0.022z" />
<glyph unicode="&#xe905;" glyph-name="file-upload" 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.905zM438.857 487.905c-8.019 0-15.814-3.102-21.238-8.762l-153.524-153.524c-5.66-5.66-8.952-13.457-8.952-21.476s3.292-15.53 8.952-21.19l17.667-17.714c5.424-5.66 13.219-8.952 21.238-8.952s15.814 3.292 21.238 8.952l69.333 69.095v-166c0-16.981 14.153-27.619 30.19-27.619h30.19c16.038 0 30.19 10.638 30.19 27.619v166l69.333-69.095c5.424-5.66 13.219-8.952 21.238-8.952s15.816 3.292 21.476 8.952l17.667 17.714c5.425 5.66 8.714 13.172 8.714 21.19s-3.29 15.816-8.714 21.476l-153.524 153.524c-5.66 5.66-13.457 8.762-21.476 8.762z" />
<glyph unicode="&#xe906;" glyph-name="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.905zM535.524 513.905c-63.766 0-115.619-51.901-115.619-115.667s51.854-115.619 115.619-115.619c48.792 0 92.974 31.714 109.238 77.667 2.84 8.261 5.905 18.862 5.905 27.381 0 5.163-3.075 9.048-8.238 9.048s-65.052-37.714-73.571-42.619l-49.857 27.619v57.857l75.667 43.619c2.323 1.549 4.143 4.398 4.143 7.238 0 3.098-1.562 5.431-4.143 7.238-15.748 10.585-40.297 16.238-59.143 16.238zM412.667 349.714l-175.81-175.81c-6.196-6.196-9.81-14.699-9.81-23.476s3.614-17.3 9.81-23.238l27.333-27.905c6.196-5.938 14.746-9.524 23.524-9.524s17.3 3.586 23.238 9.524l176.048 176.095c-33.819 13.424-60.909 40.514-74.333 74.333zM304.238 183.476c9.036 0 16.524-7.488 16.524-16.524s-7.488-16.524-16.524-16.524c-9.036 0-16.524 7.488-16.524 16.524s7.488 16.524 16.524 16.524z" />
<glyph unicode="&#xe907;" glyph-name="poll" 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.905zM569.762 482.524v-349.238h162.714v349.238h-162.714zM358.238 385.476v-252.19h162.714v252.19h-162.714zM146.667 277.381v-144.095h162.762v144.095h-162.762z" />
<glyph unicode="&#xe908;" glyph-name="slide" 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.905zM142.286 550.714v-255.238h133.19v-109.762h133.143v-109.81h326.809v255.381h-133.143v109.81h-133.143v109.619h-326.857zM191.048 501.905h229.286v-60.81h-144.857v-96.81h-84.429v157.619zM324.238 392.333h229.286v-61.048h-144.905v-96.81h-84.381v157.857zM457.381 282.524h229.286v-157.81h-229.286v157.81z" />
<glyph unicode="&#xe909;" glyph-name="sheet" 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.905zM141.286 532.571v-463.81h598.429v463.81h-598.429zM190.048 483.762h134.429v-158.714h-134.429v158.714zM373.286 483.762h134.429v-158.714h-134.429v158.714zM556.524 483.762h134.429v-158.714h-134.429v158.714zM190.048 276.286h134.429v-158.762h-134.429v158.762zM373.286 276.286h134.429v-158.762h-134.429v158.762zM556.524 276.286h134.429v-158.762h-134.429v158.762z" />
<glyph unicode="&#xe90a;" glyph-name="folder-open" d="M100.232 590.035h828.717c-5.175 69.899-63.091 124.668-133.829 124.808h-283.843l-44.936 60.235c-24.766 32.712-63.599 53.649-107.326 53.73h-170.599c-0.036 0-0.078 0-0.121 0-73.968 0-133.946-59.894-134.084-133.83v-213.366l10.12 76.74c2.295 17.95 17.476 31.684 35.865 31.684 0.012 0 0.025 0 0.037 0h-0.002zM929.19 541.606h-805.948c-13.269-0.004-24.238-9.848-26.006-22.632l-0.016-0.137-43.008-317.801c-0.002-0.261-0.003-0.569-0.003-0.877 0-6.111 0.483-12.11 1.413-17.96l-0.085 0.646c0.904-6.888 2.169-12.966 3.837-18.875l-0.223 0.925c16.563-56.812 68.138-97.63 129.257-97.702h606.698c61.093 0.086 112.628 40.906 128.907 96.752l0.237 0.95c1.459 5.065 2.725 11.228 3.544 17.531l0.070 0.66c0.844 5.201 1.327 11.196 1.327 17.304 0 0.227-0.001 0.454-0.002 0.681v-0.035l40.237 295.755c0.219 1.556 0.344 3.354 0.344 5.18 0 21.624-17.529 39.153-39.153 39.153-0.036 0-0.073 0-0.109 0h0.006z" />
<glyph unicode="&#xe90b;" glyph-name="kanban" 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.905zM146.667 493.81v-90.143h162.762v90.143h-162.762zM358.238 493.81v-90.143h162.714v90.143h-162.714zM569.762 493.81v-90.143h162.714v90.143h-162.714zM146.667 358.619v-90.143h162.762v90.143h-162.762zM569.762 358.619v-90.143h162.714v90.143h-162.714zM146.667 223.429v-90.143h162.762v90.143h-162.762z" />
<glyph unicode="&#xe90c;" glyph-name="folder" d="M373.459 846.276h-178.899c-77.457-0.137-140.211-62.891-140.348-140.335v-515.868c0.137-77.457 62.891-140.211 140.335-140.348h634.893c77.457 0.137 140.211 62.891 140.348 140.335v396.482c0 0.036 0 0.078 0 0.121 0 77.561-62.807 140.452-140.335 140.589h-296.853l-47.104 62.886c-25.923 34.066-66.406 55.898-111.999 56.139h-0.039z" />
<glyph unicode="&#xe90d;" glyph-name="shared-folder-open" d="M98.424 593.288h797.274c-4.8 67.457-60.657 120.376-128.894 120.471h-272.876l-43.249 57.705c-23.816 31.47-61.17 51.611-103.232 51.682h-164.213c-0.036 0-0.079 0-0.121 0-71.191 0-128.904-57.712-128.904-128.904 0-0.17 0-0.339 0.001-0.508v0.026-204.8l9.638 73.487c2.062 17.437 16.753 30.833 34.574 30.84h0.001zM900.759 255.608l33.973 248.049c0.196 1.447 0.308 3.12 0.308 4.819 0 20.873-16.906 37.797-37.772 37.828h-776.797c-12.746-0.016-23.272-9.5-24.923-21.796l-0.014-0.129-41.321-304.791c-0.002-0.25-0.003-0.546-0.003-0.843 0-5.87 0.483-11.628 1.412-17.235l-0.083 0.609c0.793-6.689 1.977-12.655 3.576-18.449l-0.203 0.861c15.92-54.648 65.53-93.912 124.319-93.967h583.566c0.061 0 0.133 0 0.205 0 16.48 0 32.227 3.14 46.675 8.853l-0.86-0.3c16.639-15.985 39.283-25.829 64.225-25.829 51.231 0 92.762 41.531 92.762 92.762 0 42.798-28.984 78.827-68.394 89.528l-0.65 0.15zM766.795 148.51h-583.56c-32.265 0.073-59.5 21.523-68.297 50.935l-0.13 0.506c-0.742 2.66-1.376 5.889-1.775 9.19l-0.032 0.327v1.566c0 1.566 0 3.373 0 5.301l36.382 272.023h724.751l-32.407-236.845c-1.82-0.63-3.331-1.281-4.788-2.025l0.21 0.097c-16.682-8.067-30.192-20.454-39.403-35.727l-0.232-0.415c-1.574-2.381-3.028-5.115-4.218-7.987l-0.119-0.325c-5.551-11.368-8.797-24.735-8.797-38.86 0-0.23 0.001-0.46 0.003-0.689v0.035c0-0.017 0-0.037 0-0.057 0-5.166 0.394-10.241 1.154-15.195l-0.070 0.554c-5.405-1.532-11.612-2.412-18.026-2.412-0.228 0-0.455 0.001-0.682 0.003h0.035zM877.026 84.781c-20.129 0.108-38.483 7.622-52.493 19.954l0.089-0.077c-14.994 12.543-25.212 30.362-27.788 50.568l-0.041 0.392c-0.537 3.145-0.844 6.769-0.844 10.463 0 0.091 0 0.182 0.001 0.273v-0.014c-0.001 0.109-0.001 0.239-0.001 0.368 0 12.484 2.89 24.293 8.038 34.794l-0.207-0.466c1.278 2.771 2.523 5.062 3.896 7.265l-0.161-0.278c7.898 12.884 18.884 23.175 31.958 30.024l0.449 0.214c0.692 0.493 1.491 0.902 2.346 1.186l0.064 0.018c10.065 4.991 21.914 7.922 34.445 7.951h0.010c0.046 0 0.1 0 0.154 0 7.802 0 15.336-1.144 22.444-3.275l-0.553 0.142c35.119-9.412 60.555-40.954 60.555-78.437 0-44.777-36.299-81.077-81.077-81.077-0.451 0-0.902 0.004-1.351 0.011l0.068-0.001zM906.059 183.206c9.581 0 17.348 7.767 17.348 17.348s-7.767 17.348-17.348 17.348v0c-0.002 0-0.004 0-0.007 0-9.411 0-17.072-7.495-17.341-16.841l-0.001-0.025c-0.004-0.12-0.006-0.262-0.006-0.404 0-1.849 0.356-3.615 1.003-5.232l-0.034 0.095-29.274-16.986c-3.089 3.105-7.328 5.063-12.025 5.18h-0.022c-9.003-0.772-16.019-8.271-16.019-17.408s7.015-16.636 15.954-17.404l0.065-0.004c4.719 0.117 8.958 2.075 12.046 5.179l0.001 0.001 12.047-7.228 16.504-9.638c-0.536-1.568-0.846-3.375-0.846-5.255 0-0.101 0.001-0.202 0.003-0.302v0.015c0-9.581 7.767-17.348 17.348-17.348s17.348 7.767 17.348 17.348c0 9.581-7.767 17.348-17.348 17.348v0c-5.563-0.038-10.508-2.653-13.705-6.709l-0.028-0.037-16.143 9.397-12.047 7.228c1.007 2.155 1.621 4.672 1.686 7.326v0.023c-0.052 2.758-0.667 5.36-1.736 7.712l0.050-0.122 28.672 16.625c3.116-4.367 8.151-7.19 13.848-7.228h0.006z" />
<glyph unicode="&#xe90e;" glyph-name="code" horiz-adv-x="878" d="M827.746 734.667l-173.333 173.333c-20.556 20.556-61.667 37.778-91.111 37.778h-497.778c-29.444 0-53.333-23.889-53.333-53.333v-888.889c0-29.444 23.889-53.333 53.333-53.333h746.667c29.444 0 53.333 23.889 53.333 53.333v640c0 29.444-17.222 70.556-37.778 91.111zM581.079 870.222c9.444-3.333 18.889-8.333 22.778-12.222l173.889-173.889c3.889-3.889 8.889-13.333 12.222-22.778h-208.889zM794.413 21.333h-711.111v853.333h426.667v-231.111c0-29.444 23.889-53.333 53.333-53.333h231.111zM278.857 519.111l-125.556-167.222c-4.444-6.111-4.444-15 0-21.111l125.556-167.222c6.111-7.778 17.222-9.444 25-3.333l28.333 21.111c7.778 6.111 9.444 17.222 3.333 25l-101.111 135 101.111 135c6.111 7.778 4.444 18.889-3.333 25l-28.333 21.111c-7.777 6.111-18.889 4.444-25-3.333zM724.413 351.889l-125.556 167.222c-6.111 7.778-17.222 9.444-25 3.333l-28.333-21.111c-7.777-6.111-9.444-17.222-3.333-25l101.111-135-101.111-135c-6.111-7.778-4.444-18.889 3.333-25l28.333-21.111c7.778-6.111 18.889-4.444 25 3.333l125.556 167.222c4.444 6.111 4.444 15 0 21.111zM379.968 95.778l35-5.556c9.444-1.667 18.889 4.444 20.556 14.444l76.667 461.667c1.667 9.444-4.444 18.889-14.444 20.556l-35 5.556c-9.444 1.667-18.889-4.444-20.556-14.444l-76.667-461.667c-1.667-9.444 4.444-18.889 14.444-20.556z" />
<glyph unicode="&#xe90f;" glyph-name="richtext" horiz-adv-x="878" d="M827.746 734.667l-173.333 173.333c-20.556 20.556-61.667 37.778-91.111 37.778h-497.778c-29.444 0-53.333-23.889-53.333-53.333v-888.889c0-29.444 23.889-53.333 53.333-53.333h746.667c29.444 0 53.333 23.889 53.333 53.333v640c0 29.444-17.222 70.556-37.778 91.111zM581.079 870.222c9.444-3.333 18.889-8.333 22.778-12.222l173.889-173.889c3.889-3.889 8.889-13.333 12.222-22.778h-208.889zM794.413 21.333h-711.111v853.333h426.667v-231.111c0-29.444 23.889-53.333 53.333-53.333h231.111zM225.524 501.333v-35.556c0-10 7.778-17.778 17.778-17.778h391.111c10 0 17.778 7.778 17.778 17.778v35.556c0 10-7.778 17.778-17.778 17.778h-391.111c-10 0-17.778-7.778-17.778-17.778zM634.413 376.889h-391.111c-10 0-17.778-7.778-17.778-17.778v-35.556c0-10 7.778-17.778 17.778-17.778h391.111c10 0 17.778 7.778 17.778 17.778v35.556c0 10-7.778 17.778-17.778 17.778zM634.413 234.667h-391.111c-10 0-17.778-7.778-17.778-17.778v-35.556c0-10 7.778-17.778 17.778-17.778h391.111c10 0 17.778 7.778 17.778 17.778v35.556c0 10-7.778 17.778-17.778 17.778z" />
<glyph unicode="&#xe910;" glyph-name="form-poll" horiz-adv-x="1094" d="M667.572 771.752c0 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.525zM964.853 659.687c0 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.525zM300.535 659.687c0 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.525zM330.094 505.894c0 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.525zM665.995 505.894c0 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.525zM665.995 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.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.525zM832.205 352.915h-31.571q-16.264 26.256-24.024 49.855-7.76 23.705-7.76 46.985t7.76 47.091q7.866 23.918 24.024 49.961h31.571q-13.606-25.193-20.41-49.323-6.803-24.024-6.803-47.516t6.697-47.623q6.803-24.13 20.516-49.43zM913.617 352.915q13.607 25.3 20.41 49.43t6.804 47.623-6.804 47.516q-6.803 24.13-20.41 49.323h31.571q16.158-26.044 23.918-49.961 7.866-23.811 7.866-47.091t-7.76-46.985q-7.76-23.599-24.024-49.855zM169.429 84.249h-31.571q-16.264 26.256-24.024 49.855-7.76 23.705-7.76 46.985t7.76 47.091q7.866 23.918 24.024 49.961h31.571q-13.606-25.193-20.41-49.323-6.803-24.024-6.803-47.516t6.697-47.623q6.803-24.13 20.516-49.43zM250.84 84.249q13.607 25.3 20.41 49.43t6.804 47.623-6.804 47.516q-6.803 24.13-20.41 49.323h31.571q16.158-26.044 23.918-49.961 7.866-23.811 7.866-47.091t-7.76-46.985q-7.76-23.599-24.024-49.855z" />
<glyph unicode="&#xe911;" glyph-name="palette" d="M408.6 950c-198.8-38.8-359-198.6-398.2-396.8-74-374 263.4-652.8 517.6-613.4 82.4 12.8 122.8 109.2 85 183.4-46.2 90.8 19.8 196.8 121.8 196.8h159.4c71.6 0 129.6 59.2 129.8 130.6-1 315.2-287.8 563.2-615.4 499.4zM192 320c-35.4 0-64 28.6-64 64s28.6 64 64 64 64-28.6 64-64-28.6-64-64-64zM256 576c-35.4 0-64 28.6-64 64s28.6 64 64 64 64-28.6 64-64-28.6-64-64-64zM512 704c-35.4 0-64 28.6-64 64s28.6 64 64 64 64-28.6 64-64-28.6-64-64-64zM768 576c-35.4 0-64 28.6-64 64s28.6 64 64 64 64-28.6 64-64-28.6-64-64-64z" />
<glyph unicode="&#xe912;" glyph-name="folder-upload" d="M829.44 727.251h-296.84l-47.104 62.886c-25.923 34.066-66.406 55.898-111.999 56.139h-178.938c-77.457-0.137-140.211-62.891-140.348-140.335v-515.868c0.137-77.457 62.891-140.211 140.335-140.348h634.893c77.457 0.137 140.211 62.891 140.348 140.335v396.482c0 0.036 0 0.078 0 0.121 0 77.561-62.807 140.452-140.335 140.589h-0.013zM911.119 190.072c-0.068-45.083-36.597-81.611-81.673-81.679h-634.887c-45.083 0.068-81.611 36.597-81.679 81.673v515.862c0.068 45.083 36.597 81.611 81.673 81.679h178.906c26.48-0.030 50.004-12.656 64.908-32.207l0.146-0.199 47.104-62.765 17.709-24.094h326.114c45.125-0.069 81.679-36.665 81.679-81.799 0 0 0 0 0 0v0zM562.838 166.883h-102.039v203.957h-72.523l123.723 214.076 123.723-214.076h-72.885v-203.957z" />
<glyph unicode="&#xe913;" glyph-name="add-bottom" d="M108.793 271.501c-15.312 0-27.996 12.684-27.996 27.996v55.992c0 15.312 12.684 28.006 27.996 28.006h225.414v-111.993zM108.793 495.478c-15.312 0-27.996 12.694-27.996 28.006v55.992c0 15.312 12.684 27.996 27.996 27.996h403.491v-111.993zM108.793 719.465c-15.312 0-27.996 12.694-27.996 28.006v55.992c0 15.312 12.684 27.996 27.996 27.996h615.968c15.312 0 27.996-12.684 27.996-27.996v-55.992c0-15.312-12.684-28.006-27.996-28.006zM943.202 287.839c0-19.465-15.792-35.257-35.258-35.257h-152.782v-152.782c0-19.465-15.792-35.257-35.258-35.257h-70.515c-19.465 0-35.257 15.792-35.257 35.257v152.782h-152.782c-19.465 0-35.257 15.792-35.257 35.257v70.515c0 19.465 15.792 35.258 35.257 35.258h152.782v152.782c0 19.465 15.792 35.258 35.257 35.258h70.515c19.465 0 35.258-15.792 35.258-35.258v-152.782h152.782c19.465 0 35.258-15.792 35.258-35.258z" />
<glyph unicode="&#xe914;" glyph-name="add-top" d="M108.793 624.499c-15.312 0-27.996-12.684-27.996-27.996v-55.992c0-15.312 12.684-28.006 27.996-28.006h225.414v111.993zM108.793 400.522c-15.312 0-27.996-12.694-27.996-28.006v-55.992c0-15.312 12.684-27.996 27.996-27.996h403.491v111.993zM108.793 176.535c-15.312 0-27.996-12.694-27.996-28.006v-55.992c0-15.312 12.684-27.996 27.996-27.996h615.968c15.312 0 27.996 12.684 27.996 27.996v55.992c0 15.312-12.684 28.006-27.996 28.006zM943.202 608.161c0 19.465-15.792 35.257-35.258 35.257h-152.782v152.782c0 19.465-15.792 35.257-35.258 35.257h-70.515c-19.465 0-35.257-15.792-35.257-35.257v-152.782h-152.782c-19.465 0-35.257-15.792-35.257-35.257v-70.515c0-19.465 15.792-35.258 35.257-35.258h152.782v-152.782c0-19.465 15.792-35.258 35.257-35.258h70.515c19.465 0 35.258 15.792 35.258 35.258v152.782h152.782c19.465 0 35.258 15.792 35.258 35.258z" />
<glyph unicode="&#xe915;" 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="&#xe911;" glyph-name="file" horiz-adv-x="878" d="M827.745 734.666l-173.333 173.333c-20.556 20.556-61.667 37.778-91.111 37.778h-497.777c-29.444 0-53.333-23.889-53.333-53.333v-888.887c0-29.444 23.889-53.333 53.333-53.333h746.665c29.444 0 53.333 23.889 53.333 53.333v639.999c0 29.444-17.222 70.555-37.778 91.111zM581.079 870.221c9.444-3.333 18.889-8.333 22.778-12.222l173.889-173.889c3.889-3.889 8.889-13.333 12.222-22.778h-208.889zM794.412 21.334h-711.11v853.332h426.666v-231.111c0-29.444 23.889-53.333 53.333-53.333h231.111z" />
<glyph unicode="&#xe912;" glyph-name="palette" d="M408.6 950c-198.8-38.8-359-198.6-398.2-396.8-74-374 263.4-652.8 517.6-613.4 82.4 12.8 122.8 109.2 85 183.4-46.2 90.8 19.8 196.8 121.8 196.8h159.4c71.6 0 129.6 59.2 129.8 130.6-1 315.2-287.8 563.2-615.4 499.4zM192 320c-35.4 0-64 28.6-64 64s28.6 64 64 64 64-28.6 64-64-28.6-64-64-64zM256 576c-35.4 0-64 28.6-64 64s28.6 64 64 64 64-28.6 64-64-28.6-64-64-64zM512 704c-35.4 0-64 28.6-64 64s28.6 64 64 64 64-28.6 64-64-28.6-64-64-64zM768 576c-35.4 0-64 28.6-64 64s28.6 64 64 64 64-28.6 64-64-28.6-64-64-64z" />
<glyph unicode="&#xe913;" glyph-name="folder-upload" d="M829.44 727.251h-296.84l-47.104 62.886c-25.923 34.066-66.406 55.898-111.999 56.139h-178.938c-77.457-0.137-140.211-62.891-140.348-140.335v-515.868c0.137-77.457 62.891-140.211 140.335-140.348h634.893c77.457 0.137 140.211 62.891 140.348 140.335v396.482c0 0.036 0 0.078 0 0.121 0 77.561-62.807 140.452-140.335 140.589h-0.013zM911.119 190.072c-0.068-45.083-36.597-81.611-81.673-81.679h-634.887c-45.083 0.068-81.611 36.597-81.679 81.673v515.862c0.068 45.083 36.597 81.611 81.673 81.679h178.906c26.48-0.030 50.004-12.656 64.908-32.207l0.146-0.199 47.104-62.765 17.709-24.094h326.114c45.125-0.069 81.679-36.665 81.679-81.799 0 0 0 0 0 0v0zM562.838 166.883h-102.039v203.957h-72.523l123.723 214.076 123.723-214.076h-72.885v-203.957z" />
<glyph unicode="&#xe914;" glyph-name="add-bottom" d="M108.793 271.501c-15.312 0-27.996 12.684-27.996 27.996v55.992c0 15.312 12.684 28.006 27.996 28.006h225.414v-111.993zM108.793 495.478c-15.312 0-27.996 12.694-27.996 28.006v55.992c0 15.312 12.684 27.996 27.996 27.996h403.491v-111.993zM108.793 719.465c-15.312 0-27.996 12.694-27.996 28.006v55.992c0 15.312 12.684 27.996 27.996 27.996h615.968c15.312 0 27.996-12.684 27.996-27.996v-55.992c0-15.312-12.684-28.006-27.996-28.006zM943.202 287.839c0-19.465-15.792-35.257-35.258-35.257h-152.782v-152.782c0-19.465-15.792-35.257-35.258-35.257h-70.515c-19.465 0-35.257 15.792-35.257 35.257v152.782h-152.782c-19.465 0-35.257 15.792-35.257 35.257v70.515c0 19.465 15.792 35.258 35.257 35.258h152.782v152.782c0 19.465 15.792 35.258 35.257 35.258h70.515c19.465 0 35.258-15.792 35.258-35.258v-152.782h152.782c19.465 0 35.258-15.792 35.258-35.258z" />
<glyph unicode="&#xe915;" glyph-name="add-top" d="M108.793 624.499c-15.312 0-27.996-12.684-27.996-27.996v-55.992c0-15.312 12.684-28.006 27.996-28.006h225.414v111.993zM108.793 400.522c-15.312 0-27.996-12.694-27.996-28.006v-55.992c0-15.312 12.684-27.996 27.996-27.996h403.491v111.993zM108.793 176.535c-15.312 0-27.996-12.694-27.996-28.006v-55.992c0-15.312 12.684-27.996 27.996-27.996h615.968c15.312 0 27.996 12.684 27.996 27.996v55.992c0 15.312-12.684 28.006-27.996 28.006zM943.202 608.161c0 19.465-15.792 35.257-35.258 35.257h-152.782v152.782c0 19.465-15.792 35.257-35.258 35.257h-70.515c-19.465 0-35.257-15.792-35.257-35.257v-152.782h-152.782c-19.465 0-35.257-15.792-35.257-35.257v-70.515c0-19.465 15.792-35.258 35.257-35.258h152.782v-152.782c0-19.465 15.792-35.258 35.257-35.258h70.515c19.465 0 35.258 15.792 35.258 35.258v152.782h152.782c19.465 0 35.258 15.792 35.258 35.258z" />
<glyph unicode="&#xe916;" glyph-name="form-list-check" horiz-adv-x="1094" d="M1012.362 763.843c0 8.831-7.792 16.623-16.623 16.623h-631.687c-8.831 0-16.623-7.792-16.623-16.623v-99.74c0-8.831 7.792-16.623 16.623-16.623h631.687c8.831 0 16.623 7.792 16.623 16.623zM1012.362 497.87c0 8.831-7.792 16.623-16.623 16.623h-631.687c-8.831 0-16.623-7.792-16.623-16.623v-99.74c0-8.831 7.792-16.623 16.623-16.623h631.687c8.831 0 16.623 7.792 16.623 16.623zM1012.362 231.897c0 8.831-7.792 16.623-16.623 16.623h-631.687c-8.831 0-16.623-7.792-16.623-16.623v-99.74c0-8.831 7.792-16.623 16.623-16.623h631.687c8.831 0 16.623 7.792 16.623 16.623zM279.136 239.834c0 22.077-17.911 39.988-39.988 39.988h-115.521c-22.077 0-39.988-17.911-39.988-39.988v-115.521c0-22.077 17.911-39.988 39.988-39.988h115.521c22.077 0 39.988 17.911 39.988 39.988zM307.396 779.338c0 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.525zM307.396 513.228c0 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.525z" />
<glyph unicode="&#xe917;" glyph-name="form-grid-check" horiz-adv-x="1094" d="M645.063 506.257c0 22.077-17.911 39.988-39.988 39.988h-115.521c-22.077 0-39.988-17.911-39.988-39.988v-115.521c0-22.077 17.911-39.988 39.988-39.988h115.521c22.077 0 39.988 17.911 39.988 39.988zM1011.782 771.036c0 22.077-17.911 39.988-39.988 39.988h-115.521c-22.077 0-39.988-17.911-39.988-39.988v-115.521c0-22.077 17.911-39.988 39.988-39.988h115.521c22.077 0 39.988 17.911 39.988 39.988zM279.090 506.257c0 22.077-17.911 39.988-39.988 39.988h-115.521c-22.077 0-39.988-17.911-39.988-39.988v-115.521c0-22.077 17.911-39.988 39.988-39.988h115.521c22.077 0 39.988 17.911 39.988 39.988zM279.136 239.834c0 22.077-17.911 39.988-39.988 39.988h-115.521c-22.077 0-39.988-17.911-39.988-39.988v-115.521c0-22.077 17.911-39.988 39.988-39.988h115.521c22.077 0 39.988 17.911 39.988 39.988zM1011.753 239.834c0 22.077-17.911 39.988-39.988 39.988h-115.521c-22.077 0-39.988-17.911-39.988-39.988v-115.521c0-22.077 17.911-39.988 39.988-39.988h115.521c22.077 0 39.988 17.911 39.988 39.988zM1047.594 513.673c0 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.525zM676.789 238.106c0 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.525zM676.789 771.743c0 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.525zM318.428 771.743c0 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.525z" />
<glyph unicode="&#xe918;" glyph-name="form-grid-radio" horiz-adv-x="1094" d="M181.227 823.091c-60.1 0-109.091-48.991-109.091-109.091s48.991-109.091 109.091-109.091c60.1 0 108.955 48.991 108.955 109.091s-48.855 109.091-108.955 109.091zM545.091 823.091c-60.1 0-109.091-48.991-109.091-109.091s48.991-109.091 109.091-109.091c60.1 0 109.091 48.991 109.091 109.091s-48.991 109.091-109.091 109.091zM908.955 823.091c-60.1 0-109.091-48.991-109.091-109.091s48.991-109.091 109.091-109.091c60.1 0 109.091 48.991 109.091 109.091s-48.991 109.091-109.091 109.091zM181.227 747.318c19.623 0 33.364-13.695 33.364-33.318 0-19.583-13.943-33.5-33.364-33.5-19.381 0-33.5 14.119-33.5 33.5 0 19.421 13.917 33.318 33.5 33.318zM181.227 556.955c-60.1 0-109.091-48.809-109.091-108.909s48.991-109.091 109.091-109.091c60.1 0 108.955 48.991 108.955 109.091s-48.855 108.909-108.955 108.909zM545.091 556.955c-60.1 0-109.091-48.809-109.091-108.909s48.991-109.091 109.091-109.091c60.1 0 109.091 48.991 109.091 109.091s-48.991 108.909-109.091 108.909zM908.955 556.955c-60.1 0-109.091-48.809-109.091-108.909s48.991-109.091 109.091-109.091c60.1 0 109.091 48.991 109.091 109.091s-48.991 108.909-109.091 108.909zM909.045 481.364c19.623 0 33.318-13.74 33.318-33.364 0-19.583-13.897-33.5-33.318-33.5-19.381 0-33.5 14.119-33.5 33.5 0 19.421 13.917 33.364 33.5 33.364zM181.227 291.045c-60.1 0-109.091-48.855-109.091-108.955s48.991-109.091 109.091-109.091c60.1 0 108.955 48.991 108.955 109.091s-48.855 108.955-108.955 108.955zM545.091 291.045c-60.1 0-109.091-48.855-109.091-108.955s48.991-109.091 109.091-109.091c60.1 0 109.091 48.991 109.091 109.091s-48.991 108.955-109.091 108.955zM908.955 291.045c-60.1 0-109.091-48.855-109.091-108.955s48.991-109.091 109.091-109.091c60.1 0 109.091 48.991 109.091 109.091s-48.991 108.955-109.091 108.955zM545.318 214c19.623 0 33.318-13.695 33.318-33.318 0-19.583-13.897-33.5-33.318-33.5-19.381 0-33.5 14.119-33.5 33.5 0 19.421 13.917 33.318 33.5 33.318z" />
@ -38,4 +38,5 @@
<glyph unicode="&#xe91c;" glyph-name="form-text" horiz-adv-x="1094" d="M1012.362 481.247c0 18.182-15.065 33.247-33.247 33.247h-864.413c-18.182 0-33.247-15.065-33.247-33.247v-66.493c0-18.182 15.065-33.247 33.247-33.247h864.413c18.182 0 33.247 15.065 33.247 33.247z" />
<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" />
</font></defs></svg>

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -1,10 +1,10 @@
@font-face {
font-family: 'cptools';
src: url('fonts/cptools.eot?chd5a1');
src: url('fonts/cptools.eot?chd5a1#iefix') format('embedded-opentype'),
url('fonts/cptools.ttf?chd5a1') format('truetype'),
url('fonts/cptools.woff?chd5a1') format('woff'),
url('fonts/cptools.svg?chd5a1#cptools') format('svg');
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');
font-weight: normal;
font-style: normal;
font-display: block;
@ -14,7 +14,7 @@
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'cptools' !important;
display: inline-block;
speak: none;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
@ -26,6 +26,9 @@
-moz-osx-font-smoothing: grayscale;
}
.cptools-form-conditional:before {
content: "\e900";
}
.cptools-form-poll:before {
content: "\e910";
}
@ -57,65 +60,65 @@
content: "\e91d";
}
.cptools-folder-no-color:before {
content: "\e900";
}
.cptools-whiteboard:before {
content: "\e901";
}
.cptools-new-template:before {
.cptools-whiteboard:before {
content: "\e902";
}
.cptools-shared-folder:before {
.cptools-new-template:before {
content: "\e903";
}
.cptools-file-upload:before {
.cptools-shared-folder:before {
content: "\e904";
}
.cptools-template:before {
.cptools-file-upload:before {
content: "\e905";
}
.cptools-poll:before {
.cptools-template:before {
content: "\e906";
}
.cptools-slide:before {
.cptools-poll:before {
content: "\e907";
}
.cptools-sheet:before {
.cptools-slide:before {
content: "\e908";
}
.cptools-folder-open:before {
.cptools-sheet:before {
content: "\e909";
}
.cptools-kanban:before {
.cptools-folder-open:before {
content: "\e90a";
}
.cptools-folder:before {
.cptools-kanban:before {
content: "\e90b";
}
.cptools-shared-folder-open:before {
.cptools-folder:before {
content: "\e90c";
}
.cptools-code:before {
.cptools-shared-folder-open:before {
content: "\e90d";
}
.cptools-richtext:before {
.cptools-code:before {
content: "\e90e";
}
.cptools-file:before {
.cptools-richtext:before {
content: "\e90f";
}
.cptools-palette:before {
.cptools-file:before {
content: "\e911";
}
.cptools-folder-upload:before {
.cptools-palette:before {
content: "\e912";
}
.cptools-add-bottom:before {
.cptools-folder-upload:before {
content: "\e913";
}
.cptools-add-top:before {
.cptools-add-bottom:before {
content: "\e914";
}
.cptools-destroy:before {
.cptools-add-top:before {
content: "\e915";
}
.cptools-destroy:before {
content: "\e91f";
}

View File

@ -1,6 +1,6 @@
define([
'jquery',
'/bower_components/chainpad-listmap/chainpad-listmap.js',
'chainpad-listmap',
'/bower_components/chainpad-crypto/crypto.js',
'/common/common-util.js',
'/common/outer/network-config.js',

View File

@ -105,7 +105,7 @@ define([
var imprintUrl = AppConfig.imprint && (typeof(AppConfig.imprint) === "boolean" ?
'/imprint.html' : AppConfig.imprint);
Pages.versionString = "v4.10.0";
Pages.versionString = "v4.11.0";
// used for the about menu

View File

@ -166,6 +166,9 @@
color: @cryptpad_text_col;
text-decoration: underline;
}
pre.cp-link-preview {
color: @cryptpad_text_col;
}
.cp-info-menu-container {
.logo-block {
text-align: center;

View File

@ -4,7 +4,11 @@
@width: 30px
) {
@avatar-width: @width;
@avatar-font-size: @width / 1.2;
@avatar-font-size: @width / 1.8;
// scale animal avatar to be somewhat larger, because:
// 1. emojis are wider than most latin characters
// 2. they should occupy the width of two average characters
@avatar-font-size-animal: @avatar-font-size * (6/5);
}
.avatar_main(@width: 30px) {
--LessLoader_require: LessLoader_currentFile();
@ -40,7 +44,9 @@
color: @cp_avatar-fg;
font-size: @avatar-font-size;
font-size: var(--avatar-font-size);
text-transform: capitalize;
.animal {
font-size: @avatar-font-size-animal;
}
}
media-tag {
min-height: @avatar-width;

View File

@ -51,22 +51,55 @@
}
}
.cp-charts-cell {
border: 1px solid @cp_form-border;
display: table-cell;
padding: 5px 10px;
background: @cp_form-bg2;
}
&.bar {
th {
//width: 200px !important;
font-size: 10px; // XXX
.cp-form-results-type-radio {
.cp-form-results-type-multiradio-data {
display: flex;
flex-flow: column;
}
.cp-form-results-type-radio-data {
display: table-row;
border: 1px solid @cp_form-border;
& > span {
.cp-charts-cell();
}
}
}
.cp-charts.cp-bar-table, .cp-charts.cp-text-table {
display: table;
width: 100%;
.cp-charts-row {
display: table-row;
border: 1px solid @cp_form-border;
&.full {
display: flex;
flex-flow: column;
}
td {
margin-top: 0.25em;
background: @cryptpad_color_brand_fade !important;
color: @cryptpad_color_grey_100 !important; //text_col !important;
font-weight: bold;
& > span {
.cp-charts-cell();
display: table-cell;
&.cp-value {
min-width: 200px;
}
&.cp-bar-container {
width: 99%;
padding: 0px;
position: relative;
.cp-bar {
position: absolute;
background: @cryptpad_color_brand;
height: 100%;
}
}
}
}
}
}

View File

@ -68,6 +68,25 @@
@cryptpad_color_yellow_fader: fade(#FFE69C, 15%); // not in light theme
@cryptpad_color_lighter_blue: #d2e1f2;
@cp_palette:
#FFD4D4,
#FFDECA,
#FFE69C,
#DBFFB7,
#AFFDC2,
#C9FFFE,
#C8D6FF,
#E4CAFF;
@cp_palette-dark:
darken(desaturate(extract(@cp_palette, 1),60%), 60%),
darken(desaturate(extract(@cp_palette, 2),60%), 60%),
darken(desaturate(extract(@cp_palette, 3),55%), 60%),
darken(desaturate(extract(@cp_palette, 4),55%), 70%),
darken(desaturate(extract(@cp_palette, 5),60%), 65%),
darken(desaturate(extract(@cp_palette, 6),60%), 70%),
darken(desaturate(extract(@cp_palette, 7),60%), 60%),
darken(desaturate(extract(@cp_palette, 8),70%), 60%);
@cryptpad_color_link:@cryptpad_color_brand_300;
// Premium plans colors
@ -353,15 +372,7 @@
@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:
darken(desaturate(#FFD4D4,60%), 60%),
darken(desaturate(#FFDECA,60%), 60%),
darken(desaturate(#FFE69C,55%), 60%),
darken(desaturate(#DBFFB7,55%), 70%),
darken(desaturate(#AFFDC2,60%), 65%),
darken(desaturate(#C9FFFE,60%), 70%),
darken(desaturate(#C8D6FF,60%), 60%),
darken(desaturate(#E4CAFF,70%), 60%);
@cp_kanban-colors: @cp_palette-dark;
// Notifications
@cp_notif-hover: fade(@cryptpad_color_black, 10%);
@ -438,3 +449,5 @@
@cp_form-poll-maybe: @cryptpad_color_grey_700;
@cp_form-poll-yes-color: @cryptpad_color_green;
@cp_form-invalid: @cryptpad_color_light_red;
@cp_form-palette: @cp_palette-dark;
@cp_form-palette2: @cp_palette;

View File

@ -67,6 +67,25 @@
@cryptpad_color_yellow_fade: fade(#FFE69C, 50%); // different from dark
@cryptpad_color_lighter_blue: #d2e1f2;
@cp_palette:
#FFD4D4,
#FFDECA,
#FFE69C,
#DBFFB7,
#AFFDC2,
#C9FFFE,
#C8D6FF,
#E4CAFF;
@cp_palette-dark:
darken(extract(@cp_palette, 1), 50%),
darken(extract(@cp_palette, 2), 51%),
darken(extract(@cp_palette, 3), 52%),
darken(extract(@cp_palette, 4), 61%),
darken(extract(@cp_palette, 5), 57%),
darken(extract(@cp_palette, 6), 65%),
darken(extract(@cp_palette, 7), 50%),
darken(extract(@cp_palette, 8), 50%);
@cryptpad_color_link: @cryptpad_color_brand;
// Premium plans colors
@ -299,7 +318,7 @@
@cp_usergrid-selected-fg: @cryptpad_color_white;
// Other
@cp_shadow-color: fade(@cryptpad_color_black, 40%);
@cp_shadow-color: fade(@cryptpad_color_black, 30%);
// Apps
@cp_app-bg: @cryptpad_color_grey_100;
@ -352,15 +371,7 @@
@cp_kanban-add-hover: fade(@cryptpad_color_black, 10%);
@cp_kanban-trash-bg: @cryptpad_color_warn_red;
@cp_kanban-color0: @cryptpad_color_grey_400;
@cp_kanban-colors:
#FFD4D4,
#FFDECA,
#FFE69C,
#DBFFB7,
#AFFDC2,
#C9FFFE,
#C8D6FF,
#E4CAFF;
@cp_kanban-colors: @cp_palette;
// Notifications
@cp_notif-hover: fade(@cryptpad_color_black, 10%);
@ -428,8 +439,8 @@
@cp_calendar-now-fg: @cryptpad_color_grey_200;
// Forms
@cp_form-bg1: @cryptpad_color_grey_200;
@cp_form-bg2: @cryptpad_color_grey_100;
@cp_form-bg1: @cryptpad_color_grey_50;
@cp_form-bg2: @cryptpad_color_grey_200;
@cp_form-border: @cryptpad_color_grey_200;
@cp_form-poll-color: @cryptpad_color_grey_800;
@cp_form-poll-no: fade(@cryptpad_color_light_red, 75%);
@ -437,3 +448,5 @@
@cp_form-poll-maybe: @cryptpad_color_grey_300;
@cp_form-poll-yes-color: @cryptpad_color_green;
@cp_form-invalid: @cryptpad_color_red;
@cp_form-palette: @cp_palette;
@cp_form-palette2: @cp_palette-dark;

View File

@ -364,9 +364,9 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
min-height: 20px;
height: 20px;
line-height: 20px;
min-height: 25px;
height: 25px;
line-height: 25px;
max-width: 100%;
}
.fa, .cptools {

View File

@ -112,8 +112,10 @@
border-radius: 0;
transition: none;
.fa, .cptools {
margin-right: 5px;
i, .fa, .cptools {
&:not(.nomargin) {
margin-right: 5px;
}
}
.cptools {
vertical-align: middle;

View File

@ -273,4 +273,29 @@
}
}
}
#cp-upload-preview-container {
max-width: 100%;
max-height: 300px;
overflow: auto;
margin-bottom: 15px;
// FIXME these styles yield weird results for tall, thin images
// maybe img { object-fit: contain; } or scale-down are options
// but they have problems too
media-tag {
max-width: 100%;
iframe {
// pdfs don't take the full width unless we tell them to
width: 100%;
}
& > * {
max-width: 100%;
}
}
}
input#cp-app-drive-link-url {
&.cp-input-invalid {
border: 2px solid @cryptpad_color_red;
color: @cp_form-invalid;
}
}
}

View File

@ -69,7 +69,6 @@
background: @cp_sidebar-right-bg;
color: @cp_sidebar-right-fg;
overflow: auto;
padding-bottom: 200px;
// Following rules are only in settings
.cp-sidebarlayout-element {

View File

@ -532,7 +532,13 @@
&> button {
height: @toolbar_line-height;
width: @toolbar_line-height;
span { font-size: unset; }
span {
.avatar_vars(36px);
font-size: @avatar-font-size;
.animal {
font-size: @avatar-font-size-animal;
}
}
}
&> button.cp-avatar.cp-avatar {
media-tag {
@ -855,10 +861,14 @@
span {
text-align: center;
width: 100%;
font-size: 48px;
.avatar_vars(72px);
font-size: @avatar-font-size;
display: inline-flex;
justify-content: center;
align-items: center;
.animal {
font-size: @avatar-font-size-animal;
}
}
&.cp-avatar {
.avatar_main(64px);

View File

@ -2,7 +2,7 @@
# to work with CryptPad. This example WILL NOT WORK AS IS. For best results,
# compare the sections of this configuration file against a working CryptPad
# installation (http server by the Nodejs process). If you are using CryptPad
# in production, contact sales@cryptpad.fr
# in production and require professional support please contact sales@cryptpad.fr
server {
listen 443 ssl http2;

View File

@ -123,7 +123,7 @@ module.exports.create = function (config) {
maxWorkers: config.maxWorkers,
disableIntegratedTasks: config.disableIntegratedTasks || false,
disableIntegratedEviction: typeof(config.disableIntegratedEviction) === 'undefined'? true: config.disableIntegratedEviction, // XXX 4.10.0 false,
disableIntegratedEviction: typeof(config.disableIntegratedEviction) === 'undefined'? true: config.disableIntegratedEviction, // XXX 4.11.0 false,
lastEviction: +new Date(),
evictionReport: {},
commandTimers: {},

8
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "cryptpad",
"version": "4.10.0",
"version": "4.11.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -1591,9 +1591,9 @@
}
},
"jszip": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.6.0.tgz",
"integrity": "sha512-jgnQoG9LKnWO3mnVNBnfhkh0QknICd1FGSrXcgrl67zioyJ4wgx25o9ZqwNtrROSflGBCGYnJfjrIyRIby1OoQ==",
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.7.1.tgz",
"integrity": "sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==",
"dev": true,
"requires": {
"lie": "~3.3.0",

View File

@ -1,7 +1,7 @@
{
"name": "cryptpad",
"description": "realtime collaborative visual editor with zero knowlege server",
"version": "4.10.0",
"version": "4.11.0",
"license": "AGPL-3.0+",
"repository": {
"type": "git",
@ -45,8 +45,8 @@
"lint:js": "jshint --config .jshintrc --exclude-path .jshintignore .",
"lint:server": "jshint --config .jshintrc lib",
"lint:less": "./node_modules/lesshint/bin/lesshint -c ./.lesshintrc ./customize.dist/src/less2/",
"lint:translations": "node ./scripts/lint-translations.js",
"unused-translations": "node ./scripts/unused-translations.js",
"lint:translations": "node ./scripts/translations/lint-translations.js",
"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;",

View File

@ -0,0 +1,111 @@
var Assert = require("assert");
var Util = require("../../lib/common-util");
var addIfAbsent = function (A, e) {
if (A.includes(e)) { return; }
A.push(e);
};
var findDuplicates = function (map) {
var keys = Object.keys(map);
var duplicates = {};
var markDuplicate = function (value, key1, key2) {
//console.log("[%s] === [%s] (%s)", key1, key2, value);
if (!Array.isArray(duplicates[value])) {
duplicates[value] = [];
}
addIfAbsent(duplicates[value], key1);
addIfAbsent(duplicates[value], key2);
};
keys.forEach(function (key) {
var value = map[key];
//var duplicates = [];
keys.forEach(function (key2) {
if (key === key2) { return; }
var value2 = map[key2];
if (value === value2) {
markDuplicate(value, key, key2);
}
});
});
var temp = {};
// sort keys and construct a new index using the first key in the sorted array
Object.keys(duplicates).forEach(function (key) {
var val = duplicates[key]; // should be an array
val.sort(); // default js sort
var new_key = val[0];
temp[new_key] = val;
});
var canonical = {};
Object.keys(temp).sort().forEach(function (key) {
canonical[key] = temp[key];
});
return canonical;
};
/*
var logDuplicates = function (duplicates) {
// indicate which strings are duplicated and could potentially be changed to use one key
Object.keys(duplicates).forEach(function (val) {
console.log('\"%s\" => %s', val, JSON.stringify(duplicates[val]));
});
};
*/
var FULL_LANGUAGES = {
EN: Util.clone(require("../../www/common/translations/messages.json")),
FR: Util.clone(require("../../www/common/translations/messages.fr.json")),
DE: Util.clone(require("../../www/common/translations/messages.de.json")),
JP: Util.clone(require("../../www/common/translations/messages.ja.json")),
};
var DUPLICATES = {};
Object.keys(FULL_LANGUAGES).forEach(function (code) {
DUPLICATES[code] = findDuplicates(FULL_LANGUAGES[code]);
});
var extraneousKeys = 0;
// 1) check whether the same mapping exists across languages
// ie. English has "Open" (verb) and "Open" (adjective)
// while French has "Ouvrir" and "Ouvert(s)"
// such keys should not be simplified/deduplicated
Object.keys(DUPLICATES.EN).forEach(function (key) {
var reference = DUPLICATES.EN[key];
if (!['FR', 'DE', 'JP'].every(function (code) {
try {
Assert.deepEqual(reference, DUPLICATES[code][key]);
} catch (err) {
return false;
}
return true;
})) {
return;
}
console.log("The key [%s] (\"%s\") is duplicated identically across all fully supported languages", key, FULL_LANGUAGES.EN[key]);
console.log("Values:", JSON.stringify(['EN', 'FR', 'DE', 'JP'].map(function (code) {
return FULL_LANGUAGES[code][key];
})));
console.log("Keys:", JSON.stringify(reference));
console.log();
extraneousKeys += reference.length - 1;
//console.log("\n" + code + "\n==\n");
//logDuplicates(map);
});
console.log("Total extraneous keys: %s", extraneousKeys);
// TODO
// find instances where
// one of the duplicated keys is not translated
// perhaps we could automatically use the translated one everywhere
// and improve the completeness of translations

View File

@ -1,4 +1,4 @@
var EN = require("../www/common/translations/messages.json");
var EN = require("../../www/common/translations/messages.json");
var simpleTags = [
'<br>',
@ -68,7 +68,7 @@ var processLang = function (map, lang, primary) {
if (typeof(s) !== 'string') { return; }
var usesHTML;
s.replace(/<.*?>/g, function (html) {
s.replace(/<[\s\S]*?>/g, function (html) {
if (simpleTags.indexOf(html) !== -1) { return; }
announce();
usesHTML = true;
@ -118,7 +118,7 @@ processLang(EN, 'en', true);
'zh',
].forEach(function (lang) {
try {
var map = require("../www/common/translations/messages." + lang + ".json");
var map = require("../../www/common/translations/messages." + lang + ".json");
if (!Object.keys(map).length) { return; }
processLang(map, lang);
} catch (err) {

View File

@ -1,4 +1,4 @@
var Messages = require("../www/common/translations/messages.json");
var Messages = require("../../www/common/translations/messages.json");
var Exec = require("child_process").exec;
var ignoreLines = function (source, pattern) {

0
temp.md Normal file
View File

View File

@ -1,12 +1,14 @@
@import (reference) '../../customize/src/less2/include/framework.less';
@import (reference) '../../customize/src/less2/include/sidebar-layout.less';
@import (reference) '../../customize/src/less2/include/support.less';
@import (reference) '../../customize/src/less2/include/charts.less';
&.cp-app-admin {
.framework_min_main();
.sidebar-layout_main();
.support_main();
.charts_main();
.cp-hidden {
display: none !important;
@ -294,5 +296,27 @@
}
}
}
span.cp-bar.profiling-percentage {
text-align: center;
padding: 5px;
}
span.profiling-label {
position: absolute;
z-index: 1;
width: 100%;
text-align: center;
padding: 5px;
}
#profiling-chart {
.cp-bar-container {
max-width: 400px;
}
}
.width-constrained {
max-width: 800px;
}
.cp-charts-row.heading {
font-weight: bold;
}
}

View File

@ -1673,34 +1673,51 @@ define([
var $div = makeBlock('performance-profiling'); // Msg.admin_performanceProfilingHint, .admin_performanceProfilingTitle
var onRefresh = function () {
var body = h('tbody');
var createBody = function () {
return h('div#profiling-chart.cp-charts.cp-bar-table', [
h('span.cp-charts-row.heading', [
h('span', Messages.admin_performanceKeyHeading),
h('span', Messages.admin_performanceTimeHeading),
h('span', Messages.admin_performancePercentHeading),
//h('span', ''), //Messages.admin_performancePercentHeading),
]),
]);
};
var table = h('table#cp-performance-table', [
h('thead', [
h('th', Messages.admin_performanceKeyHeading),
h('th', Messages.admin_performanceTimeHeading),
h('th', Messages.admin_performancePercentHeading),
]),
body,
]);
var appendRow = function (key, time, percent) {
console.log("[%s] %ss running time (%s%)", key, time, percent);
body.appendChild(h('tr', [ key, time, percent ].map(function (x) {
return h('td', x);
})));
var body = createBody();
var appendRow = function (key, time, percent, scaled) {
//console.log("[%s] %ss running time (%s%)", key, time, percent);
body.appendChild(h('span.cp-charts-row', [
h('span', key),
h('span', time),
//h('span', percent),
h('span.cp-bar-container', [
h('span.cp-bar.profiling-percentage', {
style: 'width: ' + scaled + '%',
}, ' ' ),
h('span.profiling-label', percent + '%'),
]),
]));
};
var process = function (_o) {
$('#profiling-chart').remove();
body = createBody();
var o = _o[0];
var sorted = Object.keys(o).sort(function (a, b) {
if (o[b] - o[a] <= 0) { return -1; }
return 1;
});
var values = sorted.map(function (k) { return o[k]; });
var total = 0;
sorted.forEach(function (k) { total += o[k]; });
values.forEach(function (value) { total += value; });
var max = Math.max.apply(null, values);
sorted.forEach(function (k) {
var percent = Math.floor((o[k] / total) * 1000) / 10;
appendRow(k, o[k], percent);
appendRow(k, o[k], percent, (o[k] / max) * 100);
});
$div.append(h('div.width-constrained', body));
};
sFrameChan.query('Q_ADMIN_RPC', {
@ -1710,10 +1727,7 @@ define([
UI.warn(Messages.error);
return void console.error(e, data);
}
//console.info(data);
$div.find("table").remove();
process(data);
$div.append(table);
});
};

View File

@ -123,6 +123,7 @@ define([
var jcalData = ICAL.parse(content);
vcalendar = new ICAL.Component(jcalData);
} catch (e) {
console.error(e);
return void cb(e);
}
@ -147,6 +148,18 @@ define([
var isAllDay = false;
var start = ev.getFirstPropertyValue('dtstart');
var end = ev.getFirstPropertyValue('dtend');
var duration = ev.getFirstPropertyValue('duration');
if (!end && !duration) {
if (start.isDate) {
end = start.clone();
end.adjust(1); // Add one day
} else {
end = start.clone();
}
} else if (!end) {
end = start.clone();
end.addDuration(duration);
}
if (start.isDate && end.isDate) {
isAllDay = true;
start = String(start);
@ -175,7 +188,7 @@ define([
hidden.push(al.toString());
}
var trigger = al.getFirstPropertyValue('trigger');
var minutes = -trigger.toSeconds() / 60;
var minutes = trigger ? (-trigger.toSeconds() / 60) : 0;
if (reminders.indexOf(minutes) === -1) { reminders.push(minutes); }
});

View File

@ -566,7 +566,7 @@ define([
attributes: {
'class': 'fa fa-trash-o',
},
content: h('span', Messages.kanban_delete),
content: h('span', Messages.poll_remove),
action: function (e) {
e.stopPropagation();
var cal = APP.calendars[id];
@ -586,8 +586,9 @@ define([
}, function (err) {
if (err) {
console.error(err);
UI.warn(Messages.error);
return void UI.warn(Messages.error);
}
renderCalendar();
});
});
}
@ -722,7 +723,7 @@ define([
if (!calendars.length) { return; }
var team = privateData.teams[teamId];
var avatar = h('span.cp-avatar');
common.displayAvatar($(avatar), team.avatar, team.displayName);
common.displayAvatar($(avatar), team.avatar, team.displayName || team.name);
APP.$calendars.append(h('div.cp-calendar-team', [
avatar,
h('span.cp-name', {title: team.name}, team.name)

View File

@ -3,7 +3,9 @@ define([
'/common/sframe-common-codemirror.js',
'/customize/messages.js',
'/bower_components/chainpad/chainpad.dist.js',
], function (Util, SFCodeMirror, Messages, ChainPad) {
'/common/inner/common-mediatag.js',
'/common/common-interface.js',
], function (Util, SFCodeMirror, Messages, ChainPad, MT, UI) {
var Markers = {};
/* TODO Known Issues
@ -38,7 +40,17 @@ define([
});
}
uid = Number(uid);
var name = Util.fixHTML(author.name || Messages.anonymous);
var name = Util.fixHTML(UI.getDisplayName(author.name));
var animal;
if ((!name || name === Messages.anonymous) && typeof(author.uid) === 'string') {
animal = MT.getPseudorandomAnimal(author.uid);
if (animal) {
name = animal + ' ' + Messages.anonymous;
} else {
name = Messages.anonymous;
}
}
var col = Util.hexToRGB(author.color);
var rgba = 'rgba('+col[0]+','+col[1]+','+col[2]+','+Env.opacity+');';
return Env.editor.markText(from, to, {
@ -520,7 +532,8 @@ define([
Env.authormarks.authors[Env.myAuthorId] = {
name: userData.name,
curvePublic: userData.curvePublic,
color: userData.color
color: userData.color,
uid: userData.uid,
};
if (!old || (old.name === userData.name && old.color === userData.color)) { return; }
return true;

View File

@ -208,5 +208,7 @@ define(function() {
// the driveless mode by changing the following value to "false"
AppConfig.allowDrivelessMode = true;
AppConfig.emojiAvatars = '🙈 🦀 🐞 🦋 🐬 🐋 🐢 🦉 🦆 🐧 🦡 🦘 🦨 🦦 🦥 🐼 🐻 🦝 🦓 🐄 💮️ 🐙️ 🌸️ 🌻️ 🐝️ 🐐 🦙 🦒 🐘 🦏 🐁 🐹 🐰 🦫 🦔 🐨 🐱 🐺 👺 👹 👽 👾 🤖'.split(/\s+/);
return AppConfig;
});

View File

@ -34,6 +34,7 @@ try {
define([
'/common/requireconfig.js'
], function (RequireConfig) {
require.config(RequireConfig());
// most of CryptPad breaks if you don't support isArray
@ -91,4 +92,10 @@ define([
} catch (e) { console.error(e); failStore(); }
require([document.querySelector('script[data-bootload]').getAttribute('data-bootload')]);
if (typeof(Promise) !== 'function') {
setTimeout(function () {
var s = "Internet Explorer is not supported anymore, including by Microsoft.\n\nMost of CryptPad's collaborative functionality requires a modern browser to work.\n\nWe recommend Mozilla Firefox.";
window.alert(s);
});
}
});

View File

@ -41,6 +41,10 @@ define([
return e;
};
UI.getDisplayName = function (name) {
return (typeof(name) === 'string'? name: "").trim() || Messages.anonymous;
};
// FIXME almost everywhere this is used would also be
// a good candidate for sframe-common's getMediatagFromHref
UI.mediaTag = function (src, key) {

View File

@ -17,7 +17,8 @@ define([
edPublic: proxy.edPublic,
curvePublic: proxy.curvePublic,
notifications: Util.find(proxy, ['mailboxes', 'notifications', 'channel']),
avatar: proxy.profile && proxy.profile.avatar
avatar: proxy.profile && proxy.profile.avatar,
uid: proxy.uid,
};
if (hash === false) { delete data.channel; }
return data;

View File

@ -196,7 +196,7 @@ define([
reader.readAsText(blob);
};
Thumb.fromBlob = function (blob, _cb) {
var cb = Util.once(_cb);
var cb = Util.once(Util.mkAsync(_cb));
// The blob is already in memory, it should be super-fast to make a thumbnail
// ==> 1s timeout
setTimeout(function () {

View File

@ -156,9 +156,11 @@ define([
var icons = Object.keys(users).map(function (key, i) {
var data = users[key];
var name = data.displayName || data.name || Messages.anonymous;
var avatar = h('span.cp-usergrid-avatar.cp-avatar');
common.displayAvatar($(avatar), data.avatar, name);
var name = UI.getDisplayName(data.displayName || data.name);
var avatar = h('span.cp-usergrid-avatar.cp-avatar', {
'aria-hidden': true,
});
common.displayAvatar($(avatar), data.avatar, name, Util.noop, data.uid);
var removeBtn, el;
if (config.remove) {
removeBtn = h('span.fa.fa-times');
@ -649,7 +651,7 @@ define([
if (!AppConfig.enableTemplates) { return; }
if (!common.isLoggedIn()) { return; }
button = $('<button>', {
'class': 'fa fa-bookmark cp-toolbar-icon-template',
'class': 'cptools cptools-new-template cp-toolbar-icon-template',
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.saveTemplateButton));
if (data.rt) {
button
@ -753,7 +755,7 @@ define([
//title: Messages.previewButtonTitle, // TODO display if the label text is collapsed
}, [
h('i.fa.fa-eye'),
h('span.cp-toolbar-name', Messages.share_linkOpen)
h('span.cp-toolbar-name', Messages.toolbar_preview)
])).click(common.prepareFeedback(type));
break;
case 'print':
@ -1437,18 +1439,25 @@ define([
window.setTimeout(function () { $innerblock.hide(); }, 0);
};
config.options.forEach(function (o) {
if (!isValidOption(o)) { return; }
if (isElement(o)) { return $innerblock.append($(o)); }
var $el = $('<' + o.tag + '>', o.attributes || {}).html(o.content || '');
$el.appendTo($innerblock);
if (typeof(o.action) === 'function') {
$el.click(function (e) {
var close = o.action(e);
if (close) { hide(); }
});
}
});
var setOptions = function (options) {
options.forEach(function (o) {
if (!isValidOption(o)) { return; }
if (isElement(o)) { return $innerblock.append($(o)); }
var $el = $('<' + o.tag + '>', o.attributes || {}).html(o.content || '');
$el.appendTo($innerblock);
if (typeof(o.action) === 'function') {
$el.click(function (e) {
var close = o.action(e);
if (close) { hide(); }
});
}
});
};
setOptions(config.options);
$container.setOptions = function (options) {
$innerblock.empty();
setOptions(options);
};
$container.append($button).append($innerblock);
@ -1579,16 +1588,20 @@ define([
}, 1000);
});
$container.setValue = function (val, name) {
$container.setValue = function (val, name, sync) {
value = val;
var $val = $innerblock.find('[data-value="'+val+'"]');
var textValue = name || $val.html() || val;
if (sync) {
$button.find('.cp-dropdown-button-title').html(textValue);
return;
}
setTimeout(function () {
$button.find('.cp-dropdown-button-title').html(textValue);
});
};
$container.getValue = function () {
return value || '';
return typeof(value) === "undefined" ? '' : value;
};
}
@ -1993,9 +2006,12 @@ define([
var loadingAvatar;
var to;
var oldUrl = '';
var oldUid;
var oldName;
var updateButton = function () {
var myData = metadataMgr.getUserData();
var privateData = metadataMgr.getPrivateData();
var uid = myData.uid;
if (!priv.plan && privateData.plan) {
config.$initBlock.empty();
metadataMgr.off('change', updateButton);
@ -2010,18 +2026,19 @@ define([
return;
}
loadingAvatar = true;
var newName = myData.name;
var newName = UI.getDisplayName(myData.name);
var url = myData.avatar;
$displayName.text(newName || Messages.anonymous);
if (accountName && oldUrl !== url) {
$displayName.text(newName);
if ((accountName && oldUrl !== url) || !accountName && uid !== oldUid || oldName !== newName) {
$avatar.html('');
Common.displayAvatar($avatar, url,
newName || Messages.anonymous, function ($img) {
Common.displayAvatar($avatar, url, newName, function ($img) {
oldUrl = url;
oldUid = uid;
oldName = newName;
$userAdmin.find('> button').removeClass('cp-avatar');
if ($img) { $userAdmin.find('> button').addClass('cp-avatar'); }
loadingAvatar = false;
});
}, uid);
return;
}
loadingAvatar = false;
@ -2303,6 +2320,7 @@ define([
var teams = Object.keys(privateData.teams).map(function (id) {
var data = privateData.teams[id];
var avatar = h('span.cp-creation-team-avatar.cp-avatar');
// We assume that teams always have a non-empty name, so we don't need a UID
common.displayAvatar($(avatar), data.avatar, data.name);
return h('div.cp-creation-team', {
'data-id': id,
@ -2431,14 +2449,14 @@ define([
}
return b.used - a.used;
});
if (!appCfg.noTemplates) {
/*if (!appCfg.noTemplates) {
allData.unshift({
name: Messages.creation_newTemplate,
id: -1,
//icon: h('span.fa.fa-bookmark')
icon: h('span.cptools.cptools-new-template')
});
}
}*/
if (!privateData.newTemplate) {
allData.unshift({
name: Messages.creation_noTemplate,
@ -3036,22 +3054,10 @@ define([
var name = Util.fixHTML(data.title);
var url = data.href;
var user = data.name;
//Messages.link_open = "Open URL";
// openLinkInNewTab ("Open Link in New Tab")
// fc_open ("Open")
// share_linkOpen ("Preview")
// resources_openInNewTab ("Open it in a new tab")
Messages.link_open = Messages.fc_open; // XXX 4.10.0
//Messages.link_store = "Store link in drive";
// toolbar_storeInDrive ? ("Store in CryptDrive")
// autostore_store ? ("Store")
Messages.link_store = Messages.toolbar_storeInDrive; // XXX 4.10.0
var content = h('div', [
UI.setHTML(h('p'), Messages._getKey('notification_openLink', [name, user])),
h('pre', url),
h('pre.cp-link-preview', url),
UIElements.getVerifiedFriend(common, data.curve, user)
]);
var clicked = false;
@ -3066,7 +3072,7 @@ define([
keys: [27]
}, {
className: 'primary',
name: Messages.link_open,
name: Messages.fc_open,
onClick: function () {
if (clicked) { return true; }
clicked = true;
@ -3076,7 +3082,7 @@ define([
keys: [13]
}, {
className: 'primary',
name: Messages.link_store,
name: Messages.toolbar_storeInDrive,
onClick: function () {
if (clicked) { return; }
clicked = true;
@ -3106,7 +3112,7 @@ define([
var sframeChan = common.getSframeChannel();
var msg = data.content.msg;
var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous;
var name = Util.fixHTML(UI.getDisplayName(msg.content.user.displayName));
var title = Util.fixHTML(msg.content.title);
var text = Messages._getKey('owner_add', [name, title]);
@ -3238,7 +3244,7 @@ define([
var sframeChan = common.getSframeChannel();
var msg = data.content.msg;
var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous;
var name = Util.fixHTML(UI.getDisplayName(msg.content.user.displayName));
var title = Util.fixHTML(msg.content.title);
var text = Messages._getKey('owner_team_add', [name, title]);
@ -3353,13 +3359,15 @@ define([
var verified = h('p');
var $verified = $(verified);
name = UI.getDisplayName(name);
if (priv.friends && priv.friends[curve]) {
$verified.addClass('cp-notifications-requestedit-verified');
var f = priv.friends[curve];
$verified.append(h('span.fa.fa-certificate'));
var $avatar = $(h('span.cp-avatar')).appendTo($verified);
$verified.append(h('p', Messages._getKey('isContact', [f.displayName])));
common.displayAvatar($avatar, f.avatar, f.displayName);
name = UI.getDisplayName(f.displayName);
$verified.append(h('p', Messages._getKey('isContact', [name])));
common.displayAvatar($avatar, f.avatar, name, Util.noop, f.uid);
} else {
$verified.append(Messages._getKey('isNotContact', [name]));
}
@ -3369,7 +3377,7 @@ define([
UIElements.displayInviteTeamModal = function (common, data) {
var msg = data.content.msg;
var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous;
var name = Util.fixHTML(UI.getDisplayName(msg.content.user.displayName));
var teamName = Util.fixHTML(Util.find(msg, ['content', 'team', 'metadata', 'name']) || '');
var verified = UIElements.getVerifiedFriend(common, msg.author, name);
@ -3453,7 +3461,8 @@ define([
name: f.displayName,
curvePublic: f.curvePublic,
profile: f.profile,
notifications: f.notifications
notifications: f.notifications,
uid: f.uid,
};
});
};
@ -3552,7 +3561,7 @@ define([
};
// Set the value to receive from the autocomplete
var toInsert = function (data, key) {
var name = data.name.replace(/[^a-zA-Z0-9]+/g, "-");
var name = UI.getDisplayName(data.name.replace(/[^a-zA-Z0-9]+/g, "-"));
return "[@"+name+"|"+key+"]";
};
@ -3605,18 +3614,20 @@ define([
var avatar = h('span.cp-avatar', {
contenteditable: false
});
common.displayAvatar($(avatar), data.avatar, data.name);
var displayName = UI.getDisplayName(data.name);
common.displayAvatar($(avatar), data.avatar, displayName);
return h('span.cp-mentions', {
'data-curve': data.curvePublic,
'data-notifications': data.notifications,
'data-profile': data.profile,
'data-name': Util.fixHTML(data.name),
'data-name': Util.fixHTML(displayName),
'data-avatar': data.avatar || "",
}, [
avatar,
h('span.cp-mentions-name', {
contenteditable: false
}, data.name)
}, displayName)
]);
};
}
@ -3648,7 +3659,7 @@ define([
}).map(function (key) {
var data = sources[key];
return {
label: data.name,
label: UI.getDisplayName(data.name),
value: key
};
});
@ -3683,10 +3694,12 @@ define([
var obj = sources[key];
if (!obj) { return; }
var avatar = h('span.cp-avatar');
common.displayAvatar($(avatar), obj.avatar, obj.name);
var displayName = UI.getDisplayName(obj.name);
common.displayAvatar($(avatar), obj.avatar, displayName, Util.noop, obj.uid);
var li = h('li.cp-autocomplete-value', [
avatar,
h('span', obj.name)
h('span', displayName),
]);
return $(li).appendTo(ul);
};

View File

@ -75,7 +75,9 @@
handlers.push(cb);
},
unreg: function (cb) {
if (handlers.indexOf(cb) === -1) { throw new Error("Not registered"); }
if (handlers.indexOf(cb) === -1) {
return void console.error("event handler was already unregistered");
}
handlers.splice(handlers.indexOf(cb), 1);
},
fire: function () {
@ -437,7 +439,7 @@
var now = +new Date();
if (last && now <= last + t) { return t - (now - last); }
last = now;
f();
f.apply(null, Util.slice(arguments));
return null;
};
};

View File

@ -1,7 +1,7 @@
define([
'/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js',
'/bower_components/netflux-websocket/netflux-client.js',
'chainpad-netflux',
'netflux-client',
'/common/common-util.js',
'/common/common-hash.js',
'/common/common-realtime.js',

View File

@ -161,7 +161,7 @@ define([
common.makeNetwork = function (cb) {
require([
'/bower_components/netflux-websocket/netflux-client.js',
'netflux-client',
'/common/outer/network-config.js'
], function (Netflux, NetConfig) {
var wsUrl = NetConfig.getWebsocketURL();

View File

@ -2800,6 +2800,7 @@ define([
var $warning = $(warning).hide();
var $url = $(url).on('change keypress keyup keydown', function () {
var v = $url.val().trim();
$url.toggleClass('cp-input-invalid', !Util.isValidURL(v));
if (v.length > 200) {
$warning.show();
return;
@ -2824,7 +2825,6 @@ define([
var u = $url.val().trim();
if (!n || !u) { return true; }
if (!Util.isValidURL(u)) {
// XXX 4.10.0 add style for invalid input? input:invalid
UI.warn(Messages.fm_link_invalid);
return true;
}

View File

@ -171,7 +171,7 @@ define([
if (!Object.keys(_friends).length) {
var friendText;
if (!friendKeys.length) {
console.error(UIElements.noContactsMessage(common));
//console.error(UIElements.noContactsMessage(common));
var findContacts = UIElements.noContactsMessage(common);
friendText = h('span.cp-app-prop-content',
findContacts.content
@ -772,7 +772,8 @@ define([
if (friend.edPublic !== ed || c === 'me') { return; }
_owners[friend.edPublic] = {
name: friend.displayName,
avatar: friend.avatar
avatar: friend.avatar,
uid: friend.uid,
};
return true;
})) {
@ -782,6 +783,11 @@ define([
_owners[ed] = {
avatar: '?',
name: Messages.owner_unknownUser,
// TODO a possible enhancement is to use data from the context
// ie. if you have opened the access modal from within the pad
// its owner might be present or they might have left some data
// in the pad itself (as is the case of the uid in rich text comments)
// TODO or just implement "Acquaintances"
};
strangers++;
});

View File

@ -1,54 +0,0 @@
define([
'/common/hyperscript.js',
], function (h) {
var Charts = {};
Charts.table = function (content, classes) {
var classString = Array.isArray(classes)? '.' + classes.filter(Boolean).join('.'): '';
return h('table' + classString, content);
};
Charts.columns = function (rows) {
return Charts.table([
//h('caption', "Front-End Developer Salary"),
h('tbody', rows.map(function (n) {
return h('tr', h('td', {
style: '--size: ' + (n / 100),
}, h('span.data', n)));
})),
], [
'charts-css',
'column',
'show-heading',
]);
};
Charts.row = function (text, count, data) {
return h('tr', [
h('th', {
scope: 'row',
}, text),
h('td', {
style: '--size: ' + count,
}, [
//text,
typeof(data) !== 'undefined'? h('span.data', data): text,
])
]);
};
// table.charts-css.bar.reverse
/*
Charts.bars = function (rows) {
return Charts.table([
], [
]);
};
*/
return Charts;
});

View File

@ -6,12 +6,13 @@ define([
'/common/hyperscript.js',
'/common/media-tag.js',
'/customize/messages.js',
'/customize/application_config.js',
'/bower_components/tweetnacl/nacl-fast.min.js',
'/bower_components/croppie/croppie.min.js',
'/bower_components/file-saver/FileSaver.min.js',
'css!/bower_components/croppie/croppie.css',
], function ($, Util, Hash, UI, h, MediaTag, Messages) {
], function ($, Util, Hash, UI, h, MediaTag, Messages, AppConfig) {
var MT = {};
var Nacl = window.nacl;
@ -43,9 +44,16 @@ define([
});
};
var animal_avatars = {};
MT.getCursorAvatar = function (cursor) {
var uid = cursor.uid;
// TODO it would be nice to have "{0} is editing" instead of just their name
var html = '<span class="cp-cursor-avatar">';
html += (cursor.avatar && avatars[cursor.avatar]) || '';
if (cursor.avatar && avatars[cursor.avatar]) {
html += avatars[cursor.avatar];
} else if (animal_avatars[uid]) {
html += animal_avatars[uid] + ' ';
}
html += Util.fixHTML(cursor.name) + '</span>';
return html;
};
@ -79,12 +87,63 @@ define([
});
};
MT.displayAvatar = function (common, $container, href, name, _cb) {
// https://emojipedia.org/nature/
var ANIMALS = AppConfig.emojiAvatars || [];
var getPseudorandomAnimal = MT.getPseudorandomAnimal = function (seed) {
if (!ANIMALS.length) { return ''; }
if (typeof(seed) !== 'string') { return; }
seed = seed.replace(/\D/g, '').slice(0, 10); // TODO possible optimization for on-wire uid
seed = parseInt(seed);
if (!seed) { return; }
return ANIMALS[seed % ANIMALS.length] || '';
};
var getPrettyInitials = MT.getPrettyInitials = function (name) {
var parts = name.split(/\s+/);
var text;
if (parts.length > 1) {
text = parts.slice(0, 2).map(Util.getFirstCharacter).join('');
} else {
text = Util.getFirstCharacter(name);
var second = Util.getFirstCharacter(name.replace(text, ''));
if (second && second !== '?') {
text += second;
}
}
return text;
};
MT.displayAvatar = function (common, $container, href, name, _cb, uid) {
var cb = Util.once(Util.mkAsync(_cb || function () {}));
var displayDefault = function () {
var text = Util.getFirstCharacter(name || Messages.anonymous);
var $avatar = $('<span>', {'class': 'cp-avatar-default'}).text(text);
var animal_avatar;
if (uid && animal_avatars[uid]) {
animal_avatar = animal_avatars[uid];
}
name = UI.getDisplayName(name);
var text;
if (ANIMALS.length && name === Messages.anonymous && uid) {
if (animal_avatar) {
text = animal_avatar;
} else {
text = animal_avatar = getPseudorandomAnimal(uid);
}
} else {
text = getPrettyInitials(name);
}
var $avatar = $('<span>', {
'class': 'cp-avatar-default' + (animal_avatar? ' animal': ''),
// this prevents screenreaders from trying to describe this
alt: '',
'aria-hidden': true,
}).text(text);
$container.append($avatar);
if (uid && animal_avatar) {
animal_avatars[uid] = animal_avatar;
}
if (cb) { cb(); }
};
if (!window.Symbol) { return void displayDefault(); } // IE doesn't have Symbol
@ -97,6 +156,7 @@ define([
return void cb($el);
}
var centerImage = function ($img, $image) {
var img = $image[0];
var w = img.width;

View File

@ -76,6 +76,7 @@ define([
var shareButton = {
className: 'primary cp-share-with-friends',
name: Messages.share_withFriends,
iconClass: '.fa.fa-shhare-alt',
onClick: function () {
var href;
nThen(function (waitFor) {
@ -420,12 +421,12 @@ define([
embed: Util.isChecked($link.find('#cp-share-embed'))
}));
});
var linkButtons = [
makeCancelButton(),
!opts.sharedFolder && {
className: 'secondary cp-nobar',
name: Messages.share_linkOpen,
iconClass: '.fa.fa-eye',
onClick: function () {
opts.saveValue();
var v = opts.getLinkValue({
@ -442,6 +443,7 @@ define([
}, {
className: 'primary cp-nobar',
name: Messages.share_linkCopy,
iconClass: '.fa.fa-link',
onClick: function () {
opts.saveValue();
var v = opts.getLinkValue({
@ -496,6 +498,7 @@ define([
{
className: 'primary',
name: Messages.share_linkCopy,
iconClass: '.fa.fa-link',
onClick: function () {
Feedback.send('SHARE_EMBED');
var v = opts.getEmbedValue();
@ -870,6 +873,7 @@ define([
{
className: 'primary',
name: Messages.share_linkCopy,
iconClass: '.fa.fa-link',
onClick: function () {
var v = opts.getLinkValue();
var success = Clipboard.copy(v);
@ -915,6 +919,7 @@ define([
}, {
className: 'primary',
name: Messages.share_mediatagCopy,
iconClass: '.fa.fa-link',
onClick: function () {
var v = common.getMediatagFromHref(opts.fileData);
var success = Clipboard.copy(v);

View File

@ -87,6 +87,7 @@ var factory = function () {
image: function (metadata, url, content, cfg, cb) {
var img = document.createElement('img');
img.setAttribute('src', url);
img.setAttribute('alt', metadata.alt || "");
img.blob = content;
cb(void 0, img);
},
@ -94,12 +95,15 @@ var factory = function () {
var video = document.createElement('video');
video.setAttribute('src', url);
video.setAttribute('controls', true);
// https://discuss.codecademy.com/t/can-we-use-an-alt-attribute-with-the-video-tag/300322/4
video.setAttribute('title', metadata.alt || "");
cb(void 0, video);
},
audio: function (metadata, url, content, cfg, cb) {
var audio = document.createElement('audio');
audio.setAttribute('src', url);
audio.setAttribute('controls', true);
audio.setAttribute('alt', metadata.alt || "");
cb(void 0, audio);
},
pdf: function (metadata, url, content, cfg, cb) {
@ -115,6 +119,7 @@ var factory = function () {
download: function (metadata, url, content, cfg, cb) {
var btn = document.createElement('button');
btn.setAttribute('class', 'btn btn-default');
btn.setAttribute('alt', metadata.alt || "");
btn.innerHTML = '<i class="fa fa-save"></i>' + cfg.download.text + '<br>' +
(metadata.name ? '<b>' + fixHTML(metadata.name) + '</b>' : '');
btn.addEventListener('click', function () {
@ -542,7 +547,7 @@ var factory = function () {
// Process
var process = function (mediaObject, decrypted, cfg, cb) {
var metadata = decrypted.metadata;
var metadata = decrypted.metadata || {};
var blob = decrypted.content;
var mediaType = getType(mediaObject, metadata, cfg);
@ -596,6 +601,15 @@ var factory = function () {
});
};
var initHandlers = function () {
return {
'progress': [],
'complete': [],
'metadata': [],
'error': []
};
};
// Initialize a media-tag
var init = function (el, cfg) {
cfg = cfg || {};
@ -613,13 +627,7 @@ var factory = function () {
};
}
var handlers = cfg.handlers || {
'progress': [],
'complete': [],
'metadata': [],
'error': []
};
var handlers = cfg.handlers || initHandlers();
var mediaObject = el._mediaObject = {
handlers: handlers,
tag: el
@ -762,15 +770,31 @@ var factory = function () {
init.fetchDecryptedMetadata = fetchDecryptedMetadata;
init.preview = function (content, metadata, cfg, cb) {
cfg = cfg || {};
addMissingConfig(cfg, config);
var handlers = cfg.handlers || initHandlers();
var el = document.createElement('media-tag');
var mediaObject = el._mediaObject = {
handlers: handlers,
tag: el,
};
process(mediaObject, {
metadata: metadata,
content: content
}, cfg, function (err) {
if (err) { return void cb(err); }
cb(void 0, el);
});
};
return init;
};
if (typeof(module) !== 'undefined' && module.exports) {
module.exports = factory();
} else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) {
define([
'/bower_components/es6-promise/es6-promise.min.js'
], function () {
define([], function () {
return factory();
});
} else {

View File

@ -190,9 +190,11 @@ define([
markup.message = function (msg) {
if (msg.type !== 'MSG') { return; }
var curvePublic = msg.author;
// FIXME this assignment looks like it has some holes in its logic
// but I'm scared to touch it because it looks like it was hacked to fix some bugs
var name = (typeof msg.name !== "undefined" || !contactsData[msg.author]) ?
(msg.name || Messages.anonymous) :
contactsData[msg.author].displayName;
contactsData[msg.author].displayName || Messages.anonymous;
var d = msg.time ? new Date(msg.time) : undefined;
var day = d ? d.toLocaleDateString() : '';
var hour = d ? d.toLocaleTimeString() : '';
@ -239,7 +241,7 @@ define([
});
var chan = state.channels[id];
var displayName = chan.name;
var displayName = UI.getDisplayName(chan.name || chan.displayName);
var fetching = false;
var $moreHistory = $(moreHistory).click(function () {
@ -364,7 +366,7 @@ define([
avatars[friend.avatar] = $img[0].outerHTML;
}
$(rightCol).insertAfter($avatar);
});
}, friend.uid);
}
var sending = false;
@ -544,7 +546,7 @@ define([
title: Messages.contacts_online
});
var rightCol = h('span.cp-app-contacts-right-col', [
h('span.cp-app-contacts-name', [room.name]),
h('span.cp-app-contacts-name', [room.isFriendChat? UI.getDisplayName(room.name): room.name]),
h('span.cp-app-contacts-icons', [
room.isFriendChat ? mute : undefined,
room.isFriendChat ? unmute : undefined,
@ -609,7 +611,7 @@ define([
avatars[friendData.avatar] = $img[0].outerHTML;
}
$room.append(rightCol);
});
}, friendData.uid);
}
$room.append(status);
return $room;
@ -631,9 +633,9 @@ define([
var el_message = markup.message(message);
if (message.type === 'MSG') {
var name = typeof message.name !== "undefined" ?
(message.name || Messages.anonymous) :
contactsData[message.author].displayName;
var name = UI.getDisplayName(typeof message.name !== "undefined" ?
message.name:
contactsData[message.author].displayName);
common.notify({
title: name,
msg: message.text,
@ -826,6 +828,11 @@ define([
}
};
/* The following block is for a disabled feature which allows users to switch
between pad chat (when in the context of a pad) and direct chats with their
contacts.
*/
/*
common.getMetadataMgr().onTitleChange(function () {
var padChat = common.getPadChat();
var md = common.getMetadataMgr().getMetadata();
@ -839,11 +846,14 @@ define([
$lAvatar.find('.cp-avatar-default, media-tag').remove();
var $div = $('<div>');
// There should always be a title here (defaultTitle if nothing else)
// so we don't ever need to supply a uid for an animal avatar
common.displayAvatar($div, null, name, function () {
$mAvatar.html($div.html());
$lAvatar.find('.cp-app-contacts-right-col').before($div.html());
});
});
*/
// TODO room
// var onJoinRoom
@ -878,7 +888,7 @@ define([
h('i.fa.fa-bell'),
Messages.contacts_unmute || 'unmute'
]);
common.displayAvatar($(avatar), data.avatar, data.name);
common.displayAvatar($(avatar), data.avatar, data.name, Util.noop, data.uid);
$(button).click(function () {
unmuteUser(curve, button);
execCommand('UNMUTE_USER', curve, function (e, data) {
@ -894,7 +904,7 @@ define([
});
return h('div.cp-contacts-muted-user', [
h('span', avatar),
h('span', data.name),
h('span', UI.getDisplayName(data.name)),
button
]);
});

View File

@ -1062,17 +1062,31 @@ define([
return;
}
var type = common.getMetadataMgr().getPrivateData().ooType;
content.locks = content.locks || {};
// Send the lock to other users
var b = obj.block && obj.block[0];
var msg = {
time: now(),
user: myUniqueOOId,
block: obj.block && obj.block[0],
block: b
};
var editor = getEditor();
if (type === "presentation" && (APP.themeChanged || APP.themeRemote) && b &&
b.guid === editor.GetPresentation().Presentation.themeLock.Id) {
APP.themeLocked = APP.themeChanged;
APP.themeChanged = undefined;
var fakeLocks = getLock();
fakeLocks[Util.uid()] = msg;
send({
type: "getLock",
locks: fakeLocks
});
return;
}
content.locks = content.locks || {};
// Send the lock to other users
var myId = getId();
content.locks[myId] = content.locks[myId] || {};
var b = obj.block && obj.block[0];
if (type === "sheet" || typeof(b) !== "string") {
var uid = Util.uid();
content.locks[myId][uid] = msg;
@ -1082,6 +1096,7 @@ define([
oldLocks = JSON.parse(JSON.stringify(content.locks));
// Remove old locks
deleteOfflineLocks();
// Prepare callback
if (cpNfInner) {
var waitLock = APP.waitLock = Util.mkEvent(true);
@ -1123,7 +1138,7 @@ define([
APP.realtime.sync();
};
var parseChanges = function (changes) {
var parseChanges = function (changes, isObj) {
try {
changes = JSON.parse(changes);
} catch (e) {
@ -1132,7 +1147,7 @@ define([
return changes.map(function (change) {
return {
docid: "fresh",
change: '"' + change + '"',
change: isObj ? change : '"' + change + '"',
time: now(),
user: myUniqueOOId,
useridoriginal: String(myOOId)
@ -1163,11 +1178,16 @@ define([
return;
}
var changes = obj.changes;
if (obj.type === "cp_theme") {
changes = JSON.stringify([JSON.stringify(obj)]);
}
// Send the changes
content.locks = content.locks || {};
rtChannel.sendMsg({
type: "saveChanges",
changes: parseChanges(obj.changes),
changes: parseChanges(changes, obj.type === "cp_theme"),
changesIndex: ooChannel.cpIndex || 0,
locks: getUserLock(getId(), true),
excelAdditionalInfo: obj.excelAdditionalInfo
@ -1221,6 +1241,11 @@ define([
if (APP.onStrictSaveChanges && !force) { return; }
// We only need to release locks for sheets
if (type !== "sheet" && obj.type === "releaseLock") { return; }
if (type === "presentation" && obj.type === "cp_theme") {
// XXX
console.error(obj);
return;
}
debug(obj, 'toOO');
chan.event('CMD', obj);
@ -1283,6 +1308,25 @@ define([
APP.onStrictSaveChanges();
return;
}
console.error(APP.isFast, APP.themeLocked);
var AscCommon = window.frames[0] && window.frames[0].AscCommon;
if (Util.find(AscCommon, ['CollaborativeEditing','m_bFast'])
&& APP.themeLocked) {
obj = APP.themeLocked;
APP.themeLocked = undefined;
obj.type = "cp_theme";
console.error(obj);
}
if (APP.themeRemote) {
delete APP.themeRemote;
send({
type: "unSaveLock",
index: ooChannel.cpIndex,
time: +new Date()
});
return;
}
// We're sending our changes to netflux
handleChanges(obj, send);
// If we're alone, clean up the medias
@ -1673,6 +1717,14 @@ define([
});
};
APP.remoteTheme = function () {
APP.themeRemote = true;
};
APP.changeTheme = function (id) {
APP.themeChanged = {
id: id
};
};
APP.openURL = function (url) {
common.openUnsafeURL(url);
};
@ -1692,7 +1744,7 @@ define([
return void callback("");
}
var blobUrl = (typeof mediasData[data.src] === 'undefined') ? "" : mediasData[data.src].src;
var blobUrl = (typeof mediasData[data.src] === 'undefined') ? "" : mediasData[data.src].blobUrl;
if (blobUrl) {
debug("CryptPad Image already loaded " + blobUrl);
return void callback(blobUrl);
@ -1717,7 +1769,11 @@ define([
try {
var blobUrl = URL.createObjectURL(res.content);
// store media blobUrl and content for cache and export
var mediaData = { blobUrl : blobUrl, content : "" };
var mediaData = {
blobUrl : blobUrl,
content : "",
name: name
};
mediasData[data.src] = mediaData;
var reader = new FileReader();
reader.onloadend = function () {
@ -1798,7 +1854,7 @@ define([
var text = getContent();
var suggestion = Title.suggestTitle(Title.defaultTitle);
var ext = ['.xlsx', '.ods', '.bin',
//'.csv', // XXX
//'.csv', // XXX 4.11.0
'.pdf'];
var type = common.getMetadataMgr().getPrivateData().ooType;
var warning = '';
@ -2274,6 +2330,26 @@ define([
makeCheckpoint(true);
});
$save.appendTo(toolbar.$bottomM);
var $dlMedias = common.createButton('', true, {
name: 'dlmedias',
icon: 'fa-download',
}, function () {
require(['/bower_components/jszip/dist/jszip.min.js'], function (JsZip) {
var zip = new JsZip();
Object.keys(mediasData || {}).forEach(function (url) {
var obj = mediasData[url];
var b = new Blob([obj.content]);
zip.file(obj.name, b, {binary: true});
});
setTimeout(function () {
zip.generateAsync({type: 'blob'}).then(function (content) {
saveAs(content, 'media.zip');
});
}, 100);
});
}).attr('title', "Download medias");
$dlMedias.appendTo(toolbar.$bottomM);
}
if (!privateData.ooVersionHash) {

View File

@ -268,13 +268,13 @@ editorType;this._isExcel=c_oEditorId.Spreadsheet===editorType;this._isPresentati
docid;this.sockjs_url=AscCommon.getBaseUrl()+"../../../../doc/"+docid+"/c"};DocsCoApi.prototype.auth=function(isViewer,opt_openCmd,opt_isIdle){this._isViewer=isViewer;if(this._locks){this.ownedLockBlocks=[];for(var block in this._locks)if(this._locks.hasOwnProperty(block)){var lock=this._locks[block];if(lock["state"]===2)this.ownedLockBlocks.push(lock["blockValue"])}this._locks={}}this._send({"type":"auth","docid":this._docid,"documentCallbackUrl":this._documentCallbackUrl,"token":this._token,"user":{"id":this._user.asc_getId(),
"username":this._user.asc_getUserName(),"firstname":this._user.asc_getFirstName(),"lastname":this._user.asc_getLastName(),"indexUser":this._indexUser},"editorType":this.editorType,"lastOtherSaveTime":this.lastOtherSaveTime,"block":this.ownedLockBlocks,"sessionId":this._id,"sessionTimeConnect":this._sessionTimeConnect,"sessionTimeIdle":opt_isIdle>=0?opt_isIdle:0,"documentFormatSave":this._documentFormatSave,"view":this._isViewer,"isCloseCoAuthoring":this.isCloseCoAuthoring,"openCmd":opt_openCmd,"lang":this.lang,
"mode":this.mode,"permissions":this.permissions,"encrypted":this.encrypted,"jwtOpen":this.jwtOpen,"jwtSession":this.jwtSession})};DocsCoApi.prototype._initSocksJs=function(){var t=this;var sockjs;sockjs=this.sockjs={};var send=function(data){setTimeout(function(){sockjs.onmessage({data:JSON.stringify(data)})})};var license={type:"license",license:{type:3,mode:0,rights:1,buildVersion:"5.2.6",buildNumber:2}};var channel;require(["/common/outer/worker-channel.js","/common/common-util.js"],function(Channel,
Util){var msgEv=Util.mkEvent();var p=window.parent;window.addEventListener("message",function(msg){if(msg.source!==p)return;msgEv.fire(msg)});var postMsg=function(data){p.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){channel=chan;send(license);chan.on("CMD",function(obj){send(obj)})})});sockjs.onopen=function(){t._state=ConnectionState.WaitAuth;t.onFirstConnect()};sockjs.onopen();sockjs.close=function(){console.error("Close realtime")};sockjs.send=function(data){try{var obj=JSON.parse(data)}catch(e){console.error(e);
return}if(channel)channel.event("CMD",obj)};sockjs.onmessage=function(e){t._onServerMessage(e.data)};return sockjs};DocsCoApi.prototype._onServerOpen=function(){if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=null;this.attemptCount=0}this._state=ConnectionState.WaitAuth;this.onFirstConnect()};DocsCoApi.prototype._onServerMessage=function(data){var dataObject=JSON.parse(data);switch(dataObject["type"]){case "auth":this._onAuth(dataObject);break;case "message":this._onMessages(dataObject,
false);break;case "cursor":this._onCursor(dataObject);break;case "meta":this._onMeta(dataObject);break;case "getLock":this._onGetLock(dataObject);break;case "releaseLock":this._onReleaseLock(dataObject);break;case "connectState":this._onConnectionStateChanged(dataObject);break;case "saveChanges":this._onSaveChanges(dataObject);break;case "authChanges":this._onAuthChanges(dataObject);break;case "saveLock":this._onSaveLock(dataObject);break;case "unSaveLock":this._onUnSaveLock(dataObject);break;case "savePartChanges":this._onSavePartChanges(dataObject);
break;case "drop":this._onDrop(dataObject);break;case "waitAuth":break;case "error":this._onDrop(dataObject);break;case "documentOpen":this._documentOpen(dataObject);break;case "warning":this._onWarning(dataObject);break;case "license":this._onLicense(dataObject);break;case "session":this._onSession(dataObject);break;case "refreshToken":this._onRefreshToken(dataObject["messages"]);break;case "expiredToken":this._onExpiredToken(dataObject);break;case "forceSaveStart":this._onForceSaveStart(dataObject["messages"]);
break;case "forceSave":this._onForceSave(dataObject["messages"]);break}};DocsCoApi.prototype._onServerClose=function(evt){if(ConnectionState.SaveChanges===this._state){this._isReSaveAfterAuth=true;if(null!==this.saveCallbackErrorTimeOutId){clearTimeout(this.saveCallbackErrorTimeOutId);this.saveCallbackErrorTimeOutId=null}}this._state=ConnectionState.Reconnect;var bIsDisconnectAtAll=c_oCloseCode.serverShutdown<=evt.code&&evt.code<=c_oCloseCode.drop||this.attemptCount>=this.maxAttemptCount;var code=
null;if(bIsDisconnectAtAll){this._state=ConnectionState.ClosedAll;code=evt.code}if(this.onDisconnect)this.onDisconnect(evt.reason,code);if(!bIsDisconnectAtAll)this._tryReconnect()};DocsCoApi.prototype._reconnect=function(){delete this.sockjs;this._initSocksJs()};DocsCoApi.prototype._tryReconnect=function(){var t=this;if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);t.reconnectTimeout=null}++this.attemptCount;this.reconnectTimeout=setTimeout(function(){t._reconnect()},this.reconnectInterval)};
window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDocsCoApi=CDocsCoApi})(window);"use strict";
Util){var msgEv=Util.mkEvent();var p=window.parent;if(editor.isReporterMode){p=window.opener;window.parent=p}else window.APP=p&&p.APP;window.addEventListener("message",function(msg){if(msg.source!==p)return;msgEv.fire(msg)});var postMsg=function(data){p.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){channel=chan;send(license);chan.on("CMD",function(obj){send(obj)})})});sockjs.onopen=function(){t._state=ConnectionState.WaitAuth;t.onFirstConnect()};sockjs.onopen();sockjs.close=function(){console.error("Close realtime")};
sockjs.send=function(data){try{var obj=JSON.parse(data)}catch(e){console.error(e);return}if(channel)channel.event("CMD",obj)};sockjs.onmessage=function(e){t._onServerMessage(e.data)};return sockjs};DocsCoApi.prototype._onServerOpen=function(){if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=null;this.attemptCount=0}this._state=ConnectionState.WaitAuth;this.onFirstConnect()};DocsCoApi.prototype._onServerMessage=function(data){var dataObject=JSON.parse(data);switch(dataObject["type"]){case "auth":this._onAuth(dataObject);
break;case "message":this._onMessages(dataObject,false);break;case "cursor":this._onCursor(dataObject);break;case "meta":this._onMeta(dataObject);break;case "getLock":this._onGetLock(dataObject);break;case "releaseLock":this._onReleaseLock(dataObject);break;case "connectState":this._onConnectionStateChanged(dataObject);break;case "saveChanges":this._onSaveChanges(dataObject);break;case "authChanges":this._onAuthChanges(dataObject);break;case "saveLock":this._onSaveLock(dataObject);break;case "unSaveLock":this._onUnSaveLock(dataObject);
break;case "savePartChanges":this._onSavePartChanges(dataObject);break;case "drop":this._onDrop(dataObject);break;case "waitAuth":break;case "error":this._onDrop(dataObject);break;case "documentOpen":this._documentOpen(dataObject);break;case "warning":this._onWarning(dataObject);break;case "license":this._onLicense(dataObject);break;case "session":this._onSession(dataObject);break;case "refreshToken":this._onRefreshToken(dataObject["messages"]);break;case "expiredToken":this._onExpiredToken(dataObject);
break;case "forceSaveStart":this._onForceSaveStart(dataObject["messages"]);break;case "forceSave":this._onForceSave(dataObject["messages"]);break}};DocsCoApi.prototype._onServerClose=function(evt){if(ConnectionState.SaveChanges===this._state){this._isReSaveAfterAuth=true;if(null!==this.saveCallbackErrorTimeOutId){clearTimeout(this.saveCallbackErrorTimeOutId);this.saveCallbackErrorTimeOutId=null}}this._state=ConnectionState.Reconnect;var bIsDisconnectAtAll=c_oCloseCode.serverShutdown<=evt.code&&evt.code<=
c_oCloseCode.drop||this.attemptCount>=this.maxAttemptCount;var code=null;if(bIsDisconnectAtAll){this._state=ConnectionState.ClosedAll;code=evt.code}if(this.onDisconnect)this.onDisconnect(evt.reason,code);if(!bIsDisconnectAtAll)this._tryReconnect()};DocsCoApi.prototype._reconnect=function(){delete this.sockjs;this._initSocksJs()};DocsCoApi.prototype._tryReconnect=function(){var t=this;if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);t.reconnectTimeout=null}++this.attemptCount;this.reconnectTimeout=
setTimeout(function(){t._reconnect()},this.reconnectInterval)};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDocsCoApi=CDocsCoApi})(window);"use strict";
(function(window){var CSpellCheckApi=function(){this._SpellCheckApi=new SpellCheckApi;this._onlineWork=false;this.onDisconnect=null;this.onSpellCheck=null};CSpellCheckApi.prototype.init=function(docid){if(this._SpellCheckApi&&this._SpellCheckApi.isRightURL()){var t=this;this._SpellCheckApi.onDisconnect=function(e,isDisconnectAtAll,isCloseCoAuthoring){t.callback_OnDisconnect(e,isDisconnectAtAll,isCloseCoAuthoring)};this._SpellCheckApi.onSpellCheck=function(e){t.callback_OnSpellCheck(e)};this._SpellCheckApi.onInit=
function(e){t.callback_OnInit(e)};this._SpellCheckApi.init(docid);this._onlineWork=true}};CSpellCheckApi.prototype.set_url=function(url){if(this._SpellCheckApi)this._SpellCheckApi.set_url(url)};CSpellCheckApi.prototype.get_state=function(){if(this._SpellCheckApi)return this._SpellCheckApi.get_state();return 0};CSpellCheckApi.prototype.disconnect=function(){if(this._SpellCheckApi&&this._onlineWork)this._SpellCheckApi.disconnect()};CSpellCheckApi.prototype.spellCheck=function(spellCheckData){if(this._SpellCheckApi&&
this._onlineWork)this._SpellCheckApi.spellCheck(spellCheckData)};CSpellCheckApi.prototype.checkDictionary=function(lang){if(this._SpellCheckApi&&this._onlineWork)return this._SpellCheckApi.checkDictionary(lang);return true};CSpellCheckApi.prototype.callback_OnSpellCheck=function(e){if(this.onSpellCheck)return this.onSpellCheck(e)};CSpellCheckApi.prototype.callback_OnInit=function(e){if(this.onInit)return this.onInit(e)};CSpellCheckApi.prototype.callback_OnDisconnect=function(e,isDisconnectAtAll,isCloseCoAuthoring){if(this.onDisconnect)return this.onDisconnect(e,

View File

@ -8425,87 +8425,88 @@ oThis.loadImageCallBackCounterMax)oThis.LoadImagesWithCallbackEnd()};oImage.Imag
this.loadImageCallBackArgs);this.loadImageCallBack=null;this.loadImageCallBackArgs=null;this.loadImageCallBackCounterMax=0;this.loadImageCallBackCounter=0}}var g_flow_anchor=new Image;g_flow_anchor.asc_complete=false;g_flow_anchor.onload=function(){g_flow_anchor.asc_complete=true};g_flow_anchor.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPBAMAAADNDVhEAAAAIVBMVEUAAAANDQ0NDQ0NDQ0NDQ0NDQ0AAAANDQ0NDQ0NDQ0NDQ1jk7YPAAAACnRSTlMAGkD4mb9c5s9TDghpXQAAAFZJREFUCNdjYGBgW8YABlxcIBLBZ1gAEfZa5QWiGRkWMAIpAaA4iHQE0YwODEtANMsChkIwv4BBWQBICyswMC1iWADEDAzKoUuDFUAGNC9uABvIaQkkABpxD6lFb9lRAAAAAElFTkSuQmCC";
var g_flow_anchor2=new Image;g_flow_anchor2.asc_complete=false;g_flow_anchor2.onload=function(){g_flow_anchor2.asc_complete=true};g_flow_anchor2.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAeCAMAAAAFBf7qAAAAOVBMVEUAAAAAAAAAAAAAAAAJCQkAAAAJCQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJCQknI0ZQAAAAEnRSTlMAx9ITlAfyPHxn68yecTAl5qt6y0BvAAAAt0lEQVQoz8WS0QrDIAxFk0ajtlXb+/8fuzAprltg7Gnn4aIcvAgJTSSoBiGPoIAGV60qoquvIIL110IJgPONmKIlMI73MiwGRoZvahbKVSizcDKU8QeVPDXEIr6ShVB9VUEn2FOMkwL8VwjUtuypvDWiHeVTFeyWkZHfVQZHGm4XMhKQyJB9GKMxuHQSBlioF7u2q7kzgO2AcWwW3F8mWRmGKgyu91mK1Tzh4ixVVkBzJI/EnGjyACbfCaO3eIWRAAAAAElFTkSuQmCC";
window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].g_font_loader=new CGlobalFontLoader;window["AscCommon"].g_image_loader=new CGlobalImageLoader;window["AscCommon"].g_flow_anchor=g_flow_anchor;window["AscCommon"].g_flow_anchor2=g_flow_anchor2})(window,window.document);"use strict";(function(window,undefined){var FOREIGN_CURSOR_LABEL_HIDETIME=1500;function CCollaborativeChanges(){this.m_pData=null;this.m_oColor=null}CCollaborativeChanges.prototype.Set_Data=function(pData){this.m_pData=
pData};CCollaborativeChanges.prototype.Set_Color=function(oColor){this.m_oColor=oColor};CCollaborativeChanges.prototype.Set_FromUndoRedo=function(Class,Data,Binary){if(!Class.Get_Id)return false;this.m_pData=this.private_SaveData(Binary);return true};CCollaborativeChanges.prototype.Apply_Data=function(){var CollaborativeEditing=AscCommon.CollaborativeEditing;var Reader=this.private_LoadData(this.m_pData);var ClassId=Reader.GetString2();var Class=AscCommon.g_oTableId.Get_ById(ClassId);if(!Class)return false;
var nReaderPos=Reader.GetCurPos();var nChangesType=Reader.GetLong();var fChangesClass=AscDFH.changesFactory[nChangesType];if(fChangesClass){var oChange=new fChangesClass(Class);oChange.ReadFromBinary(Reader);if(true===CollaborativeEditing.private_AddOverallChange(oChange))oChange.Load(this.m_oColor);return true}else{CollaborativeEditing.private_AddOverallChange(this.m_pData);Reader.Seek2(nReaderPos);if(!Class.Load_Changes)return false;return Class.Load_Changes(Reader,null,this.m_oColor)}};CCollaborativeChanges.prototype.private_LoadData=
function(szSrc){return this.GetStream(szSrc,0,szSrc.length)};CCollaborativeChanges.prototype.GetStream=function(szSrc,offset,srcLen){var nWritten=0;var index=-1+offset;var dst_len="";while(true){index++;var _c=szSrc.charCodeAt(index);if(_c==";".charCodeAt(0)){index++;break}dst_len+=String.fromCharCode(_c)}var dstLen=parseInt(dst_len);var pointer=AscFonts.g_memory.Alloc(dstLen);var stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var dstPx=stream.data;if(window.chrome)while(index<
srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=
nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len;return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=
[];this.m_bGlobalLock=0;this.m_bGlobalLockSelection=0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex=
0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes=[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors();
this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast=function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing=function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType=
0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)};CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index<Len;Index++)if(this.m_aUsers[Index]===UserId)return Index;return-1};CCollaborativeEditingBase.prototype.Remove_User=function(UserId){var Pos=this.Find_User(UserId);if(-1!=Pos)this.m_aUsers.splice(Pos,1)};CCollaborativeEditingBase.prototype.Add_Changes=function(Changes){this.m_aChanges.push(Changes)};
CCollaborativeEditingBase.prototype.Add_Unlock=function(LockClass){this.m_aNeedUnlock.push(LockClass)};CCollaborativeEditingBase.prototype.Add_Unlock2=function(Lock){this.m_aNeedUnlock2.push(Lock);editor._onUpdateDocumentCanSave()};CCollaborativeEditingBase.prototype.Have_OtherChanges=function(){return 0<this.m_aChanges.length};CCollaborativeEditingBase.prototype.Apply_Changes=function(){var OtherChanges=this.m_aChanges.length>0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate();
editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult();editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges();this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length>
0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length;for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i];Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length};
CCollaborativeEditingBase.prototype.Send_Changes=function(){};CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges=function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i<aImages.length;++i)rData["data"].push(aImages[i]);var aImagesToLoad=[].concat(AscCommon.CollaborativeEditing.m_aNewImages);
this.CheckWaitingImages(aImagesToLoad);AscCommon.CollaborativeEditing.m_aNewImages.length=0;if(false===oApi.isSaveFonts_Images)oApi.isSaveFonts_Images=true;AscCommon.CollaborativeEditing.SendImagesCallback(aImagesToLoad)};CCollaborativeEditingBase.prototype.SendImagesCallback=function(aImages){var oApi=editor||Asc["editor"];oApi.pre_Save(aImages)};CCollaborativeEditingBase.prototype.CollectImagesFromChanges=function(){var oApi=editor||Asc["editor"];var aImages=[],sImagePath,i,sImageFromChanges,oThemeUrls=
{};var aNewImages=this.m_aNewImages;var oMap={};for(i=0;i<aNewImages.length;++i){sImageFromChanges=aNewImages[i];if(oMap[sImageFromChanges])continue;oMap[sImageFromChanges]=1;if(sImageFromChanges.indexOf("theme")===0&&oApi.ThemeLoader)oThemeUrls[sImageFromChanges]=oApi.ThemeLoader.ThemesUrlAbs+sImageFromChanges;else if(0===sImageFromChanges.indexOf("http:")||0===sImageFromChanges.indexOf("data:")||0===sImageFromChanges.indexOf("https:")||0===sImageFromChanges.indexOf("file:")||0===sImageFromChanges.indexOf("ftp:"));
else{sImagePath=AscCommon.g_oDocumentUrls.mediaPrefix+sImageFromChanges;if(!AscCommon.g_oDocumentUrls.getUrl(sImagePath))aImages.push(sImagePath)}}AscCommon.g_oDocumentUrls.addUrls(oThemeUrls);return aImages};CCollaborativeEditingBase.prototype.OnStart_Load_Objects=function(){this.Set_GlobalLock(true);this.Set_GlobalLockSelection(true);var aImages=this.CollectImagesFromChanges();if(aImages.length>0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages));
this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData=function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})};CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aLinkData[Index];Item.Class.Load_LinkData(Item.LinkData)}this.Clear_LinkData()};
CCollaborativeEditingBase.prototype.Check_MergeData=function(){};CCollaborativeEditingBase.prototype.Get_GlobalLock=function(){return 0===this.m_bGlobalLock?false:true};CCollaborativeEditingBase.prototype.Set_GlobalLock=function(isLock){if(isLock)this.m_bGlobalLock++;else this.m_bGlobalLock=Math.max(0,this.m_bGlobalLock-1)};CCollaborativeEditingBase.prototype.Set_GlobalLockSelection=function(isLock){if(isLock)this.m_bGlobalLockSelection++;else this.m_bGlobalLockSelection=Math.max(0,this.m_bGlobalLockSelection-
1)};CCollaborativeEditingBase.prototype.Get_GlobalLockSelection=function(){return 0===this.m_bGlobalLockSelection?false:true};CCollaborativeEditingBase.prototype.OnStart_CheckLock=function(){this.m_aCheckLocks.length=0;this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.Add_CheckLock=function(oItem){this.m_aCheckLocks.push(oItem);this.m_aCheckLocksInstance.push(oItem)};CCollaborativeEditingBase.prototype.OnEnd_CheckLock=function(){};CCollaborativeEditingBase.prototype.OnCallback_AskLock=
function(result){};CCollaborativeEditingBase.prototype.OnStartCheckLockInstance=function(){this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.OnEndCheckLockInstance=function(){var isLocked=false;for(var nIndex=0,nCount=this.m_aCheckLocksInstance.length;nIndex<nCount;++nIndex)if(true===this.m_aCheckLocksInstance[nIndex]){isLocked=true;break}if(isLocked){var nCount=this.m_aCheckLocksInstance.length;this.m_aCheckLocks.splice(this.m_aCheckLocks.length-nCount,nCount)}this.m_aCheckLocksInstance.length=
0;return isLocked};CCollaborativeEditingBase.prototype.Reset_NeedLock=function(){this.m_aNeedLock={}};CCollaborativeEditingBase.prototype.Add_NeedLock=function(Id,sUser){this.m_aNeedLock[Id]=sUser};CCollaborativeEditingBase.prototype.Remove_NeedLock=function(Id){delete this.m_aNeedLock[Id]};CCollaborativeEditingBase.prototype.Lock_NeedLock=function(){for(var Id in this.m_aNeedLock){var Class=AscCommon.g_oTableId.Get_ById(Id);if(null!=Class){var Lock=Class.Lock;Lock.Set_Type(AscCommon.locktype_Other,
false);if(Class.getObjectType&&Class.getObjectType()===AscDFH.historyitem_type_Slide)editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide&&editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide(Class.num);Lock.Set_UserId(this.m_aNeedLock[Id])}}this.Reset_NeedLock()};CCollaborativeEditingBase.prototype.Clear_NewObjects=function(){this.m_aNewObjects.length=0};CCollaborativeEditingBase.prototype.Add_NewObject=function(Class){this.m_aNewObjects.push(Class);Class.FromBinary=true};CCollaborativeEditingBase.prototype.Clear_EndActions=
function(){this.m_aEndActions.length=0};CCollaborativeEditingBase.prototype.Add_EndActions=function(Class,Data){this.m_aEndActions.push({Class:Class,Data:Data})};CCollaborativeEditingBase.prototype.OnEnd_ReadForeignChanges=function(){var Count=this.m_aNewObjects.length;for(var Index=0;Index<Count;Index++){var Class=this.m_aNewObjects[Index];Class.FromBinary=false}Count=this.m_aEndActions.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aEndActions[Index];Item.Class.Process_EndLoad(Item.Data)}this.Clear_EndActions();
this.Clear_NewObjects()};CCollaborativeEditingBase.prototype.Clear_NewImages=function(){this.m_aNewImages.length=0};CCollaborativeEditingBase.prototype.Add_NewImage=function(Url){this.m_aNewImages.push(Url)};CCollaborativeEditingBase.prototype.Add_NewDC=function(Class){var Id=Class.Get_Id();this.m_aDC[Id]=Class};CCollaborativeEditingBase.prototype.Clear_DCChanges=function(){for(var Id in this.m_aDC)this.m_aDC[Id].Clear_ContentChanges();this.m_aDC={}};CCollaborativeEditingBase.prototype.Refresh_DCChanges=
function(){for(var Id in this.m_aDC)this.m_aDC[Id].Refresh_ContentChanges();this.Clear_DCChanges()};CCollaborativeEditingBase.prototype.AddPosExtChanges=function(Item,ChangeObject){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=function(){};CCollaborativeEditingBase.prototype.RewritePosExtChanges=function(changesArr,scale,Binary_Writer){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=function(){};CCollaborativeEditingBase.prototype.Add_ChangedClass=function(Class){var Id=Class.Get_Id();
this.m_aChangedClasses[Id]=Class};CCollaborativeEditingBase.prototype.Clear_CollaborativeMarks=function(bRepaint){for(var Id in this.m_aChangedClasses)this.m_aChangedClasses[Id].Clear_CollaborativeMarks();this.m_aChangedClasses={};if(true===bRepaint){editor.WordControl.m_oLogicDocument.DrawingDocument.ClearCachePages();editor.WordControl.m_oLogicDocument.DrawingDocument.FirePaint()}};CCollaborativeEditingBase.prototype.Add_ForeignCursorToUpdate=function(UserId,CursorInfo,UserShortId){this.m_aCursorsToUpdate[UserId]=
CursorInfo;this.m_aCursorsToUpdateShortId[UserId]=UserShortId};CCollaborativeEditingBase.prototype.Refresh_ForeignCursors=function(){if(!this.m_oLogicDocument)return;for(var UserId in this.m_aCursorsToUpdate){var CursorInfo=this.m_aCursorsToUpdate[UserId];this.m_oLogicDocument.Update_ForeignCursor(CursorInfo,UserId,false,this.m_aCursorsToUpdateShortId[UserId]);if(this.Add_ForeignCursorToShow)this.Add_ForeignCursorToShow(UserId)}this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={}};CCollaborativeEditingBase.prototype.Clear_DocumentPositions=
function(){this.m_aDocumentPositions.Clear_DocumentPositions()};CCollaborativeEditingBase.prototype.Add_DocumentPosition=function(DocumentPos){this.m_aDocumentPositions.Add_DocumentPosition(DocumentPos)};CCollaborativeEditingBase.prototype.Add_ForeignCursor=function(UserId,DocumentPos,UserShortId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);this.m_aForeignCursors[UserId]=DocumentPos;this.m_aForeignCursorsPos.Add_DocumentPosition(DocumentPos);this.m_aForeignCursorsId[UserId]=
UserShortId};CCollaborativeEditingBase.prototype.Remove_ForeignCursor=function(UserId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);delete this.m_aForeignCursors[UserId]};CCollaborativeEditingBase.prototype.Remove_AllForeignCursors=function(){};CCollaborativeEditingBase.prototype.RemoveMyCursorFromOthers=function(){};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){this.m_aDocumentPositions.Update_DocumentPositionsOnAdd(Class,
Pos);this.m_aForeignCursorsPos.Update_DocumentPositionsOnAdd(Class,Pos)};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnRemove=function(Class,Pos,Count){this.m_aDocumentPositions.Update_DocumentPositionsOnRemove(Class,Pos,Count);this.m_aForeignCursorsPos.Update_DocumentPositionsOnRemove(Class,Pos,Count)};CCollaborativeEditingBase.prototype.OnStart_SplitRun=function(SplitRun,SplitPos){this.m_aDocumentPositions.OnStart_SplitRun(SplitRun,SplitPos);this.m_aForeignCursorsPos.OnStart_SplitRun(SplitRun,
SplitPos)};CCollaborativeEditingBase.prototype.OnEnd_SplitRun=function(NewRun){this.m_aDocumentPositions.OnEnd_SplitRun(NewRun);this.m_aForeignCursorsPos.OnEnd_SplitRun(NewRun)};CCollaborativeEditingBase.prototype.Update_DocumentPosition=function(DocPos){this.m_aDocumentPositions.Update_DocumentPosition(DocPos)};CCollaborativeEditingBase.prototype.Update_ForeignCursorsPositions=function(){};CCollaborativeEditingBase.prototype.InitMemory=function(){if(!this.m_oMemory)this.m_oMemory=new AscCommon.CMemory};
CCollaborativeEditingBase.prototype.private_SaveDocumentState=function(){var LogicDocument=editor.WordControl.m_oLogicDocument;var DocState;if(true!==this.Is_Fast()){DocState=LogicDocument.Get_SelectionState2();this.m_aCursorsToUpdate={}}else DocState=LogicDocument.Save_DocumentStateBeforeLoadChanges();return DocState};CCollaborativeEditingBase.prototype.private_RestoreDocumentState=function(DocState){var LogicDocument=editor.WordControl.m_oLogicDocument;if(true!==this.Is_Fast())LogicDocument.Set_SelectionState2(DocState);
else{LogicDocument.Load_DocumentStateAfterLoadChanges(DocState);this.Refresh_ForeignCursors()}};CCollaborativeEditingBase.prototype.WatchDocumentPositionsByState=function(DocState){this.Clear_DocumentPositions();if(DocState.Pos)this.Add_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Add_DocumentPosition(DocState.StartPos);if(DocState.EndPos)this.Add_DocumentPosition(DocState.EndPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Add_DocumentPosition(DocState.FootnotesStart.Pos);
if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Add_DocumentPosition(DocState.FootnotesStart.StartPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Add_DocumentPosition(DocState.FootnotesStart.EndPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Add_DocumentPosition(DocState.FootnotesEnd.Pos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Add_DocumentPosition(DocState.FootnotesEnd.StartPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Add_DocumentPosition(DocState.FootnotesEnd.EndPos)};
CCollaborativeEditingBase.prototype.UpdateDocumentPositionsByState=function(DocState){if(DocState.Pos)this.Update_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Update_DocumentPosition(DocState.StartPos);if(DocState.EndPos)this.Update_DocumentPosition(DocState.EndPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Update_DocumentPosition(DocState.FootnotesStart.Pos);if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Update_DocumentPosition(DocState.FootnotesStart.StartPos);
if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Update_DocumentPosition(DocState.FootnotesStart.EndPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Update_DocumentPosition(DocState.FootnotesEnd.Pos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Update_DocumentPosition(DocState.FootnotesEnd.StartPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Update_DocumentPosition(DocState.FootnotesEnd.EndPos)};CCollaborativeEditingBase.prototype.private_ClearChanges=
function(){this.m_aChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=function(){};CCollaborativeEditingBase.prototype.private_AddOverallChange=function(oChange){return true};CCollaborativeEditingBase.prototype.private_ClearChanges=function(){this.m_aChanges=[];this.m_oOwnChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=function(){var StartPoint=null===AscCommon.History.SavedIndex?0:AscCommon.History.SavedIndex+1;var LastPoint=-1;if(this.m_nUseType<=
0)LastPoint=AscCommon.History.Points.length-1;else LastPoint=AscCommon.History.Index;for(var PointIndex=StartPoint;PointIndex<=LastPoint;PointIndex++){var Point=AscCommon.History.Points[PointIndex];for(var Index=0;Index<Point.Items.length;Index++){var Item=Point.Items[Index];this.m_oOwnChanges.push(Item.Data)}}};CCollaborativeEditingBase.prototype.private_AddOverallChange=function(oChange,isSave){for(var nIndex=0,nCount=this.m_oOwnChanges.length;nIndex<nCount;++nIndex)if(oChange&&oChange.Merge&&false===
oChange.Merge(this.m_oOwnChanges[nIndex]))return false;if(false!==isSave)this.m_aAllChanges.push(oChange);return true};CCollaborativeEditingBase.prototype.private_OnSendOwnChanges=function(arrChanges,nDeleteIndex){if(null!==nDeleteIndex)this.m_aAllChanges.length=this.m_nAllChangesSavedIndex+nDeleteIndex;else this.m_nAllChangesSavedIndex=this.m_aAllChanges.length;if(arrChanges.length>0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges=
this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length-1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange=this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange=
oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length=this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex=0,nCount=arrChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrChanges[nIndex].CreateReverseChange();if(oReverseChange){arrReverseChanges.push(oReverseChange);
oReverseChange.SetReverted(true)}}var oLogicDocument=this.m_oLogicDocument;oLogicDocument.DrawingDocument.EndTrackTable(null,true);oLogicDocument.TurnOffCheckChartSelection();var DocState=this.private_SaveDocumentState();var mapDrawings={};for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oClass=arrReverseChanges[nIndex].GetClass();if(oClass&&oClass.parent&&oClass.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.parent.Get_Id()]=oClass.parent;arrReverseChanges[nIndex].Load();
this.m_aAllChanges.push(arrReverseChanges[nIndex])}var mapDocumentContents={};var mapParagraphs={};var mapRuns={};var mapTables={};var mapGrObjects={};var mapSlides={};var mapLayouts={};var bChangedLayout=false;var bAddSlides=false;var mapAddedSlides={};for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oChange=arrReverseChanges[nIndex];var oClass=oChange.GetClass();if(oClass instanceof AscCommonWord.CDocument||oClass instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oClass.Get_Id()]=
oClass;else if(oClass instanceof AscCommonWord.Paragraph)mapParagraphs[oClass.Get_Id()]=oClass;else if(oClass.IsParagraphContentElement&&true===oClass.IsParagraphContentElement()&&true===oChange.IsContentChange()&&oClass.GetParagraph()){mapParagraphs[oClass.GetParagraph().Get_Id()]=oClass.GetParagraph();if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=oClass}else if(oClass instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=
oClass;else if(oClass instanceof AscCommonWord.CTable)mapTables[oClass.Get_Id()]=oClass;else if(oClass instanceof AscFormat.CShape||oClass instanceof AscFormat.CImageShape||oClass instanceof AscFormat.CChartSpace||oClass instanceof AscFormat.CGroupShape||oClass instanceof AscFormat.CGraphicFrame)mapGrObjects[oClass.Get_Id()]=oClass;else if(typeof AscCommonSlide!=="undefined")if(AscCommonSlide.Slide&&oClass instanceof AscCommonSlide.Slide)mapSlides[oClass.Get_Id()]=oClass;else if(AscCommonSlide.SlideLayout&&
oClass instanceof AscCommonSlide.SlideLayout){mapLayouts[oClass.Get_Id()]=oClass;bChangedLayout=true}else if(AscCommonSlide.CPresentation&&oClass instanceof AscCommonSlide.CPresentation)if(oChange.Type===AscDFH.historyitem_Presentation_RemoveSlide||oChange.Type===AscDFH.historyitem_Presentation_AddSlide){bAddSlides=true;for(var i=0;i<oChange.Items.length;++i)mapAddedSlides[oChange.Items[i].Get_Id()]=oChange.Items[i]}}var oHistory=AscCommon.History;oHistory.CreateNewPointForCollectChanges();if(bAddSlides)for(var i=
oLogicDocument.Slides.length-1;i>-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent();if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout=oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape=
mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id());else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]=oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing=
mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun=mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex>-1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1,
false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof AscCommonWord.CDocument||oTable.Parent instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent=
mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex,1)}nContentLen=oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph=
new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter;var aSendingChanges=[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrReverseChanges[nIndex];var oChangeClass=oReverseChange.GetClass();
var nBinaryPos=oBinaryWriter.GetCurPosition();oBinaryWriter.WriteString2(oChangeClass.Get_Id());oBinaryWriter.WriteLong(oReverseChange.Type);oReverseChange.WriteToBinary(oBinaryWriter);var nBinaryLen=oBinaryWriter.GetCurPosition()-nBinaryPos;var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,oReverseChange,{Pos:nBinaryPos,Len:nBinaryLen});aSendingChanges.push(oChange.m_pData)}var oHistoryPoint=oHistory.Points[oHistory.Points.length-1];for(var nIndex=0,nCount=oHistoryPoint.Items.length;nIndex<
nCount;++nIndex){var oReverseChange=oHistoryPoint.Items[nIndex].Data;var oChangeClass=oReverseChange.GetClass();var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,oReverseChange,{Pos:oHistoryPoint.Items[nIndex].Binary.Pos,Len:oHistoryPoint.Items[nIndex].Binary.Len});aSendingChanges.push(oChange.m_pData);arrReverseChanges.push(oHistoryPoint.Items[nIndex].Data)}oHistory.Remove_LastPoint();this.Clear_DCChanges();editor.CoAuthoringApi.saveChanges(aSendingChanges,null,
null,false,this.getCollaborativeEditing());this.private_RestoreDocumentState(DocState);oLogicDocument.TurnOnCheckChartSelection();this.private_RecalculateDocument(AscCommon.History.Get_RecalcData(null,arrReverseChanges));oLogicDocument.Document_UpdateSelectionState();oLogicDocument.Document_UpdateInterfaceState();oLogicDocument.Document_UpdateRulersState()};CCollaborativeEditingBase.prototype.CanUndo=function(){return this.m_aOwnChangesIndexes.length<=0?false:true};CCollaborativeEditingBase.prototype.private_CommutateContentChanges=
function(oChange,nStartPosition){var arrActions=oChange.ConvertToSimpleActions();var arrCommutateActions=[];for(var nActionIndex=arrActions.length-1;nActionIndex>=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount=this.m_aAllChanges.length;nIndex<nOverallCount;++nIndex){var oTempChange=this.m_aAllChanges[nIndex];if(!oTempChange)continue;if(oChange.IsRelated(oTempChange)&&true!==oTempChange.IsReverted()){var arrOtherActions=oTempChange.ConvertToSimpleActions();
for(var nIndex2=0,nOtherActionsCount2=arrOtherActions.length;nIndex2<nOtherActionsCount2;++nIndex2){var oOtherAction=arrOtherActions[nIndex2];if(false===this.private_Commutate(oAction,oOtherAction)){arrOtherActions.splice(nIndex2,1);oResult=null;break}}oTempChange.ConvertFromSimpleActions(arrOtherActions)}if(!oResult)break}if(null!==oResult)arrCommutateActions.push(oResult)}if(arrCommutateActions.length>0)oChange.ConvertFromSimpleActions(arrCommutateActions);else return false;return true};CCollaborativeEditingBase.prototype.private_Commutate=
function(oActionL,oActionR){if(oActionL.Add)if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;else oActionR.Pos--;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else if(oActionL.Pos===oActionR.Pos)return false;else oActionR.Pos--;else if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;else oActionR.Pos++;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else oActionR.Pos++;return true};CCollaborativeEditingBase.prototype.private_CommutatePropertyChanges=function(oClass,oChange,
nStartPosition){if(oChange.CheckCorrect&&!oChange.CheckCorrect())return false;return true};CCollaborativeEditingBase.prototype.private_RecalculateDocument=function(oRecalcData){};function CDocumentPositionsManager(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=[]}CDocumentPositionsManager.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=[]};CDocumentPositionsManager.prototype.Add_DocumentPosition=
function(Position){this.m_aDocumentPositions.push(Position)};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex<PosCount;++PosIndex){var DocPos=this.m_aDocumentPositions[PosIndex];for(var ClassPos=0,ClassLen=DocPos.length;ClassPos<ClassLen;++ClassPos){var _Pos=DocPos[ClassPos];if(Class===_Pos.Class&&undefined!==_Pos.Position&&(_Pos.Position>Pos||_Pos.Position===Pos&&!(Class instanceof AscCommonWord.ParaRun))){_Pos.Position++;
break}}}};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnRemove=function(Class,Pos,Count){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex<PosCount;++PosIndex){var DocPos=this.m_aDocumentPositions[PosIndex];for(var ClassPos=0,ClassLen=DocPos.length;ClassPos<ClassLen;++ClassPos){var _Pos=DocPos[ClassPos];if(Class===_Pos.Class&&undefined!==_Pos.Position){if(_Pos.Position>Pos+Count)_Pos.Position-=Count;else if(_Pos.Position>=Pos){_Pos.Position=Pos;_Pos.Deleted=true}break}}}};
CDocumentPositionsManager.prototype.OnStart_SplitRun=function(SplitRun,SplitPos){this.m_aDocumentPositionsSplit=[];for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex<PosCount;++PosIndex){var DocPos=this.m_aDocumentPositions[PosIndex];for(var ClassPos=0,ClassLen=DocPos.length;ClassPos<ClassLen;++ClassPos){var _Pos=DocPos[ClassPos];if(SplitRun===_Pos.Class&&_Pos.Position&&_Pos.Position>=SplitPos)this.m_aDocumentPositionsSplit.push({DocPos:DocPos,NewRunPos:_Pos.Position-SplitPos})}}};
CDocumentPositionsManager.prototype.OnEnd_SplitRun=function(NewRun){if(!NewRun)return;for(var PosIndex=0,PosCount=this.m_aDocumentPositionsSplit.length;PosIndex<PosCount;++PosIndex){var NewDocPos=[];NewDocPos.push({Class:NewRun,Position:this.m_aDocumentPositionsSplit[PosIndex].NewRunPos});this.m_aDocumentPositions.push(NewDocPos);this.m_aDocumentPositionsMap.push({StartPos:this.m_aDocumentPositionsSplit[PosIndex].DocPos,EndPos:NewDocPos})}};CDocumentPositionsManager.prototype.Update_DocumentPosition=
function(DocPos){var NewDocPos=DocPos;for(var PosIndex=0,PosCount=this.m_aDocumentPositionsMap.length;PosIndex<PosCount;++PosIndex)if(this.m_aDocumentPositionsMap[PosIndex].StartPos===NewDocPos)NewDocPos=this.m_aDocumentPositionsMap[PosIndex].EndPos;if(NewDocPos!==DocPos&&NewDocPos.length===1&&NewDocPos[0].Class instanceof AscCommonWord.ParaRun){var Run=NewDocPos[0].Class;var Para=Run.GetParagraph();if(AscCommonWord.CanUpdatePosition(Para,Run)){DocPos.length=0;Run.GetDocumentPositionFromObject(DocPos);
DocPos.push({Class:Run,Position:NewDocPos[0].Position})}}else if(DocPos.length>0&&DocPos[DocPos.length-1].Class instanceof AscCommonWord.ParaRun){var Run=DocPos[DocPos.length-1].Class;var RunPos=DocPos[DocPos.length-1].Position;var Para=Run.GetParagraph();if(AscCommonWord.CanUpdatePosition(Para,Run)){DocPos.length=0;Run.GetDocumentPositionFromObject(DocPos);DocPos.push({Class:Run,Position:RunPos})}}};CDocumentPositionsManager.prototype.Remove_DocumentPosition=function(DocPos){for(var Pos=0,Count=
this.m_aDocumentPositions.length;Pos<Count;++Pos)if(this.m_aDocumentPositions[Pos]===DocPos){this.m_aDocumentPositions.splice(Pos,1);return}};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].FOREIGN_CURSOR_LABEL_HIDETIME=FOREIGN_CURSOR_LABEL_HIDETIME;window["AscCommon"].CCollaborativeChanges=CCollaborativeChanges;window["AscCommon"].CCollaborativeEditingBase=CCollaborativeEditingBase;window["AscCommon"].CDocumentPositionsManager=CDocumentPositionsManager})(window);"use strict";(function(window,
undefined){var g_dKoef_mm_to_pix=AscCommon.g_dKoef_mm_to_pix;function CBounds(){this.L=0;this.T=0;this.R=0;this.B=0;this.isAbsL=false;this.isAbsT=false;this.isAbsR=false;this.isAbsB=false;this.AbsW=-1;this.AbsH=-1;this.SetParams=function(_l,_t,_r,_b,abs_l,abs_t,abs_r,abs_b,absW,absH){this.L=_l;this.T=_t;this.R=_r;this.B=_b;this.isAbsL=abs_l;this.isAbsT=abs_t;this.isAbsR=abs_r;this.isAbsB=abs_b;this.AbsW=absW;this.AbsH=absH}}function CAbsolutePosition(){this.L=0;this.T=0;this.R=0;this.B=0}var g_anchor_left=
1;var g_anchor_top=2;var g_anchor_right=4;var g_anchor_bottom=8;function CControl(){this.Bounds=new CBounds;this.Anchor=g_anchor_left|g_anchor_top;this.Name=null;this.Parent=null;this.TabIndex=null;this.HtmlElement=null;this.AbsolutePosition=new CBounds;this.Resize=function(_width,_height,api){if(null==this.Parent||null==this.HtmlElement)return;var _x=0;var _y=0;var _r=0;var _b=0;var hor_anchor=this.Anchor&5;var ver_anchor=this.Anchor&10;if(g_anchor_left==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L;
else _x=this.Bounds.L*_width/1E3;if(-1!=this.Bounds.AbsW)_r=_x+this.Bounds.AbsW;else if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3}else if(g_anchor_right==hor_anchor){if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3;if(-1!=this.Bounds.AbsW)_x=_r-this.Bounds.AbsW;else if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3}else if((g_anchor_left|g_anchor_right)==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=
this.Bounds.L*_width/1E3;if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3}else{_x=this.Bounds.L;_r=this.Bounds.R}if(g_anchor_top==ver_anchor){if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3;if(-1!=this.Bounds.AbsH)_b=_y+this.Bounds.AbsH;else if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3}else if(g_anchor_bottom==ver_anchor){if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3;if(-1!=
this.Bounds.AbsH)_y=_b-this.Bounds.AbsH;else if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3}else if((g_anchor_top|g_anchor_bottom)==ver_anchor){if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3;if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3}else{_y=this.Bounds.T;_b=this.Bounds.B}if(_r<_x)_r=_x;if(_b<_y)_b=_y;this.AbsolutePosition.L=_x;this.AbsolutePosition.T=_y;this.AbsolutePosition.R=_r;this.AbsolutePosition.B=_b;
this.HtmlElement.style.left=(_x*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.top=(_y*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.width=((_r-_x)*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.height=((_b-_y)*g_dKoef_mm_to_pix+.5>>0)+"px";if(api!==undefined&&api.CheckRetinaElement&&api.CheckRetinaElement(this.HtmlElement)){var _W=(_r-_x)*g_dKoef_mm_to_pix+.5>>0;var _H=(_b-_y)*g_dKoef_mm_to_pix+.5>>0;this.HtmlElement.width=AscCommon.AscBrowser.convertToRetinaValue(_W,true);this.HtmlElement.height=
AscCommon.AscBrowser.convertToRetinaValue(_H,true)}else{this.HtmlElement.width=(_r-_x)*g_dKoef_mm_to_pix+.5>>0;this.HtmlElement.height=(_b-_y)*g_dKoef_mm_to_pix+.5>>0}};this.GetCSS_width=function(){return(this.AbsolutePosition.R-this.AbsolutePosition.L)*g_dKoef_mm_to_pix+.5>>0};this.GetCSS_height=function(){return(this.AbsolutePosition.B-this.AbsolutePosition.T)*g_dKoef_mm_to_pix+.5>>0}}function CControlContainer(){this.Bounds=new CBounds;this.Anchor=g_anchor_left|g_anchor_top;this.Name=null;this.Parent=
null;this.TabIndex=null;this.HtmlElement=null;this.AbsolutePosition=new CBounds;this.Controls=[];this.AddControl=function(ctrl){ctrl.Parent=this;this.Controls[this.Controls.length]=ctrl};this.Resize=function(_width,_height,api){if(null==this.Parent){this.AbsolutePosition.L=0;this.AbsolutePosition.T=0;this.AbsolutePosition.R=_width;this.AbsolutePosition.B=_height;if(null!=this.HtmlElement){var lCount=this.Controls.length;for(var i=0;i<lCount;i++)this.Controls[i].Resize(_width,_height,api)}return}var _x=
0;var _y=0;var _r=0;var _b=0;var hor_anchor=this.Anchor&5;var ver_anchor=this.Anchor&10;if(g_anchor_left==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3;if(-1!=this.Bounds.AbsW)_r=_x+this.Bounds.AbsW;else if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3}else if(g_anchor_right==hor_anchor){if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3;if(-1!=this.Bounds.AbsW)_x=_r-this.Bounds.AbsW;else if(this.Bounds.isAbsL)_x=
this.Bounds.L;else _x=this.Bounds.L*_width/1E3}else if((g_anchor_left|g_anchor_right)==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3;if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3}else{_x=this.Bounds.L;_r=this.Bounds.R}if(g_anchor_top==ver_anchor){if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3;if(-1!=this.Bounds.AbsH)_b=_y+this.Bounds.AbsH;else if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*
_height/1E3}else if(g_anchor_bottom==ver_anchor){if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3;if(-1!=this.Bounds.AbsH)_y=_b-this.Bounds.AbsH;else if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3}else if((g_anchor_top|g_anchor_bottom)==ver_anchor){if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3;if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3}else{_y=this.Bounds.T;_b=this.Bounds.B}if(_r<
_x)_r=_x;if(_b<_y)_b=_y;this.AbsolutePosition.L=_x;this.AbsolutePosition.T=_y;this.AbsolutePosition.R=_r;this.AbsolutePosition.B=_b;this.HtmlElement.style.left=(_x*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.top=(_y*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.width=((_r-_x)*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.height=((_b-_y)*g_dKoef_mm_to_pix+.5>>0)+"px";var lCount=this.Controls.length;for(var i=0;i<lCount;i++)this.Controls[i].Resize(_r-_x,_b-_y,api)};this.GetCSS_width=
function(){return(this.AbsolutePosition.R-this.AbsolutePosition.L)*g_dKoef_mm_to_pix+.5>>0};this.GetCSS_height=function(){return(this.AbsolutePosition.B-this.AbsolutePosition.T)*g_dKoef_mm_to_pix+.5>>0}}function CreateControlContainer(name){var ctrl=new CControlContainer;ctrl.Name=name;ctrl.HtmlElement=document.getElementById(name);return ctrl}function CreateControl(name){var ctrl=new CControl;ctrl.Name=name;ctrl.HtmlElement=document.getElementById(name);return ctrl}window["AscCommon"]=window["AscCommon"]||
{};window["AscCommon"].g_anchor_left=g_anchor_left;window["AscCommon"].g_anchor_top=g_anchor_top;window["AscCommon"].g_anchor_right=g_anchor_right;window["AscCommon"].g_anchor_bottom=g_anchor_bottom;window["AscCommon"].CreateControlContainer=CreateControlContainer;window["AscCommon"].CreateControl=CreateControl})(window);"use strict";(function(window,undefined){var AscBrowser=AscCommon.AscBrowser;var TRACK_CIRCLE_RADIUS=5;var TRACK_RECT_SIZE2=4;var TRACK_RECT_SIZE=8;var TRACK_RECT_SIZE_CT=6;var TRACK_DISTANCE_ROTATE=
25;var TRACK_DISTANCE_ROTATE2=25;var TRACK_ADJUSTMENT_SIZE=10;var TRACK_WRAPPOINTS_SIZE=6;var IMAGE_ROTATE_TRACK_W=21;var bIsUseImageRotateTrack=true;if(bIsUseImageRotateTrack){window.g_track_rotate_marker=new Image;window.g_track_rotate_marker;window.g_track_rotate_marker.asc_complete=false;window.g_track_rotate_marker.onload=function(){window.g_track_rotate_marker.asc_complete=true};window.g_track_rotate_marker.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAAVFBMVEUAAAD///////////////////////////////////////////////////////98fHy2trb09PTT09OysrKqqqqJiYng4ODr6+uamprGxsbi4uKGhoYjgM0eAAAADnRSTlMAy00k7/z0jbeuMzDljsugwZgAAACpSURBVBjTdZHbEoMgDESDAl6bgIqX9v//s67UYpm6D0xyYMImoaiuUr3pVdVRUtnwqaY8YaE5SRcfaPgqc+DSIh7WIGGaEVoUqRGN4oZlcDIiqYlaPjQz5CNu6cFJwLiuSO3nlLBDrKhn3l4rcnH4NcAdGd5EZMfCsoMFBxM6CD57G+u6vC48PMVnHtrYhP/x+7+3cw7zdJnD3cyA7QXa4nYXaW+a9Xdvb6zqE5Jb7LmzAAAAAElFTkSuQmCC";
pData};CCollaborativeChanges.prototype.Set_Color=function(oColor){this.m_oColor=oColor};CCollaborativeChanges.prototype.Set_FromUndoRedo=function(Class,Data,Binary){if(!Class.Get_Id)return false;this.m_pData=this.private_SaveData(Binary);return true};CCollaborativeChanges.prototype.Apply_Data=function(){var CollaborativeEditing=AscCommon.CollaborativeEditing;if(this.m_pData&&this.m_pData.type==="cp_theme"){clearTimeout(window.CP_theme_to);var data=this.m_pData;window.CP_theme_to=setTimeout(function(){window.parent.APP.remoteTheme();
window.editor.ChangeTheme(data.id,null,true)});return true}var Reader=this.private_LoadData(this.m_pData);var ClassId=Reader.GetString2();var Class=AscCommon.g_oTableId.Get_ById(ClassId);if(!Class)return false;var nReaderPos=Reader.GetCurPos();var nChangesType=Reader.GetLong();var fChangesClass=AscDFH.changesFactory[nChangesType];if(fChangesClass){var oChange=new fChangesClass(Class);oChange.ReadFromBinary(Reader);if(true===CollaborativeEditing.private_AddOverallChange(oChange))oChange.Load(this.m_oColor);
return true}else{CollaborativeEditing.private_AddOverallChange(this.m_pData);Reader.Seek2(nReaderPos);if(!Class.Load_Changes)return false;return Class.Load_Changes(Reader,null,this.m_oColor)}};CCollaborativeChanges.prototype.private_LoadData=function(szSrc){return this.GetStream(szSrc,0,szSrc.length)};CCollaborativeChanges.prototype.GetStream=function(szSrc,offset,srcLen){var nWritten=0;var index=-1+offset;var dst_len="";while(true){index++;var _c=szSrc.charCodeAt(index);if(_c==";".charCodeAt(0)){index++;
break}dst_len+=String.fromCharCode(_c)}var dstLen=parseInt(dst_len);var pointer=AscFonts.g_memory.Alloc(dstLen);var stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var dstPx=stream.data;if(window.chrome)while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&
16711680)>>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len;
return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_bGlobalLock=0;this.m_bGlobalLockSelection=0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId=
{};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex=0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes=[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=
[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors();this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast=function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing=
function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType=0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)};CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index<Len;Index++)if(this.m_aUsers[Index]===
UserId)return Index;return-1};CCollaborativeEditingBase.prototype.Remove_User=function(UserId){var Pos=this.Find_User(UserId);if(-1!=Pos)this.m_aUsers.splice(Pos,1)};CCollaborativeEditingBase.prototype.Add_Changes=function(Changes){this.m_aChanges.push(Changes)};CCollaborativeEditingBase.prototype.Add_Unlock=function(LockClass){this.m_aNeedUnlock.push(LockClass)};CCollaborativeEditingBase.prototype.Add_Unlock2=function(Lock){this.m_aNeedUnlock2.push(Lock);editor._onUpdateDocumentCanSave()};CCollaborativeEditingBase.prototype.Have_OtherChanges=
function(){return 0<this.m_aChanges.length};CCollaborativeEditingBase.prototype.Apply_Changes=function(){var OtherChanges=this.m_aChanges.length>0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate();editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult();editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges();
this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length>0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length;for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i];
Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length};CCollaborativeEditingBase.prototype.Send_Changes=function(){};CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges=
function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i<aImages.length;++i)rData["data"].push(aImages[i]);var aImagesToLoad=[].concat(AscCommon.CollaborativeEditing.m_aNewImages);this.CheckWaitingImages(aImagesToLoad);AscCommon.CollaborativeEditing.m_aNewImages.length=0;if(false===oApi.isSaveFonts_Images)oApi.isSaveFonts_Images=true;AscCommon.CollaborativeEditing.SendImagesCallback(aImagesToLoad)};CCollaborativeEditingBase.prototype.SendImagesCallback=
function(aImages){var oApi=editor||Asc["editor"];oApi.pre_Save(aImages)};CCollaborativeEditingBase.prototype.CollectImagesFromChanges=function(){var oApi=editor||Asc["editor"];var aImages=[],sImagePath,i,sImageFromChanges,oThemeUrls={};var aNewImages=this.m_aNewImages;var oMap={};for(i=0;i<aNewImages.length;++i){sImageFromChanges=aNewImages[i];if(oMap[sImageFromChanges])continue;oMap[sImageFromChanges]=1;if(sImageFromChanges.indexOf("theme")===0&&oApi.ThemeLoader)oThemeUrls[sImageFromChanges]=oApi.ThemeLoader.ThemesUrlAbs+
sImageFromChanges;else if(0===sImageFromChanges.indexOf("http:")||0===sImageFromChanges.indexOf("data:")||0===sImageFromChanges.indexOf("https:")||0===sImageFromChanges.indexOf("file:")||0===sImageFromChanges.indexOf("ftp:"));else{sImagePath=AscCommon.g_oDocumentUrls.mediaPrefix+sImageFromChanges;if(!AscCommon.g_oDocumentUrls.getUrl(sImagePath))aImages.push(sImagePath)}}AscCommon.g_oDocumentUrls.addUrls(oThemeUrls);return aImages};CCollaborativeEditingBase.prototype.OnStart_Load_Objects=function(){this.Set_GlobalLock(true);
this.Set_GlobalLockSelection(true);var aImages=this.CollectImagesFromChanges();if(aImages.length>0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages));this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData=function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})};
CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aLinkData[Index];Item.Class.Load_LinkData(Item.LinkData)}this.Clear_LinkData()};CCollaborativeEditingBase.prototype.Check_MergeData=function(){};CCollaborativeEditingBase.prototype.Get_GlobalLock=function(){return 0===this.m_bGlobalLock?false:true};CCollaborativeEditingBase.prototype.Set_GlobalLock=function(isLock){if(isLock)this.m_bGlobalLock++;else this.m_bGlobalLock=
Math.max(0,this.m_bGlobalLock-1)};CCollaborativeEditingBase.prototype.Set_GlobalLockSelection=function(isLock){if(isLock)this.m_bGlobalLockSelection++;else this.m_bGlobalLockSelection=Math.max(0,this.m_bGlobalLockSelection-1)};CCollaborativeEditingBase.prototype.Get_GlobalLockSelection=function(){return 0===this.m_bGlobalLockSelection?false:true};CCollaborativeEditingBase.prototype.OnStart_CheckLock=function(){this.m_aCheckLocks.length=0;this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.Add_CheckLock=
function(oItem){this.m_aCheckLocks.push(oItem);this.m_aCheckLocksInstance.push(oItem)};CCollaborativeEditingBase.prototype.OnEnd_CheckLock=function(){};CCollaborativeEditingBase.prototype.OnCallback_AskLock=function(result){};CCollaborativeEditingBase.prototype.OnStartCheckLockInstance=function(){this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.OnEndCheckLockInstance=function(){var isLocked=false;for(var nIndex=0,nCount=this.m_aCheckLocksInstance.length;nIndex<nCount;++nIndex)if(true===
this.m_aCheckLocksInstance[nIndex]){isLocked=true;break}if(isLocked){var nCount=this.m_aCheckLocksInstance.length;this.m_aCheckLocks.splice(this.m_aCheckLocks.length-nCount,nCount)}this.m_aCheckLocksInstance.length=0;return isLocked};CCollaborativeEditingBase.prototype.Reset_NeedLock=function(){this.m_aNeedLock={}};CCollaborativeEditingBase.prototype.Add_NeedLock=function(Id,sUser){this.m_aNeedLock[Id]=sUser};CCollaborativeEditingBase.prototype.Remove_NeedLock=function(Id){delete this.m_aNeedLock[Id]};
CCollaborativeEditingBase.prototype.Lock_NeedLock=function(){for(var Id in this.m_aNeedLock){var Class=AscCommon.g_oTableId.Get_ById(Id);if(null!=Class){var Lock=Class.Lock;Lock.Set_Type(AscCommon.locktype_Other,false);if(Class.getObjectType&&Class.getObjectType()===AscDFH.historyitem_type_Slide)editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide&&editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide(Class.num);Lock.Set_UserId(this.m_aNeedLock[Id])}}this.Reset_NeedLock()};CCollaborativeEditingBase.prototype.Clear_NewObjects=
function(){this.m_aNewObjects.length=0};CCollaborativeEditingBase.prototype.Add_NewObject=function(Class){this.m_aNewObjects.push(Class);Class.FromBinary=true};CCollaborativeEditingBase.prototype.Clear_EndActions=function(){this.m_aEndActions.length=0};CCollaborativeEditingBase.prototype.Add_EndActions=function(Class,Data){this.m_aEndActions.push({Class:Class,Data:Data})};CCollaborativeEditingBase.prototype.OnEnd_ReadForeignChanges=function(){var Count=this.m_aNewObjects.length;for(var Index=0;Index<
Count;Index++){var Class=this.m_aNewObjects[Index];Class.FromBinary=false}Count=this.m_aEndActions.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aEndActions[Index];Item.Class.Process_EndLoad(Item.Data)}this.Clear_EndActions();this.Clear_NewObjects()};CCollaborativeEditingBase.prototype.Clear_NewImages=function(){this.m_aNewImages.length=0};CCollaborativeEditingBase.prototype.Add_NewImage=function(Url){this.m_aNewImages.push(Url)};CCollaborativeEditingBase.prototype.Add_NewDC=function(Class){var Id=
Class.Get_Id();this.m_aDC[Id]=Class};CCollaborativeEditingBase.prototype.Clear_DCChanges=function(){for(var Id in this.m_aDC)this.m_aDC[Id].Clear_ContentChanges();this.m_aDC={}};CCollaborativeEditingBase.prototype.Refresh_DCChanges=function(){for(var Id in this.m_aDC)this.m_aDC[Id].Refresh_ContentChanges();this.Clear_DCChanges()};CCollaborativeEditingBase.prototype.AddPosExtChanges=function(Item,ChangeObject){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=function(){};CCollaborativeEditingBase.prototype.RewritePosExtChanges=
function(changesArr,scale,Binary_Writer){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=function(){};CCollaborativeEditingBase.prototype.Add_ChangedClass=function(Class){var Id=Class.Get_Id();this.m_aChangedClasses[Id]=Class};CCollaborativeEditingBase.prototype.Clear_CollaborativeMarks=function(bRepaint){for(var Id in this.m_aChangedClasses)this.m_aChangedClasses[Id].Clear_CollaborativeMarks();this.m_aChangedClasses={};if(true===bRepaint){editor.WordControl.m_oLogicDocument.DrawingDocument.ClearCachePages();
editor.WordControl.m_oLogicDocument.DrawingDocument.FirePaint()}};CCollaborativeEditingBase.prototype.Add_ForeignCursorToUpdate=function(UserId,CursorInfo,UserShortId){this.m_aCursorsToUpdate[UserId]=CursorInfo;this.m_aCursorsToUpdateShortId[UserId]=UserShortId};CCollaborativeEditingBase.prototype.Refresh_ForeignCursors=function(){if(!this.m_oLogicDocument)return;for(var UserId in this.m_aCursorsToUpdate){var CursorInfo=this.m_aCursorsToUpdate[UserId];this.m_oLogicDocument.Update_ForeignCursor(CursorInfo,
UserId,false,this.m_aCursorsToUpdateShortId[UserId]);if(this.Add_ForeignCursorToShow)this.Add_ForeignCursorToShow(UserId)}this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={}};CCollaborativeEditingBase.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions.Clear_DocumentPositions()};CCollaborativeEditingBase.prototype.Add_DocumentPosition=function(DocumentPos){this.m_aDocumentPositions.Add_DocumentPosition(DocumentPos)};CCollaborativeEditingBase.prototype.Add_ForeignCursor=
function(UserId,DocumentPos,UserShortId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);this.m_aForeignCursors[UserId]=DocumentPos;this.m_aForeignCursorsPos.Add_DocumentPosition(DocumentPos);this.m_aForeignCursorsId[UserId]=UserShortId};CCollaborativeEditingBase.prototype.Remove_ForeignCursor=function(UserId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);delete this.m_aForeignCursors[UserId]};CCollaborativeEditingBase.prototype.Remove_AllForeignCursors=
function(){};CCollaborativeEditingBase.prototype.RemoveMyCursorFromOthers=function(){};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){this.m_aDocumentPositions.Update_DocumentPositionsOnAdd(Class,Pos);this.m_aForeignCursorsPos.Update_DocumentPositionsOnAdd(Class,Pos)};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnRemove=function(Class,Pos,Count){this.m_aDocumentPositions.Update_DocumentPositionsOnRemove(Class,Pos,Count);this.m_aForeignCursorsPos.Update_DocumentPositionsOnRemove(Class,
Pos,Count)};CCollaborativeEditingBase.prototype.OnStart_SplitRun=function(SplitRun,SplitPos){this.m_aDocumentPositions.OnStart_SplitRun(SplitRun,SplitPos);this.m_aForeignCursorsPos.OnStart_SplitRun(SplitRun,SplitPos)};CCollaborativeEditingBase.prototype.OnEnd_SplitRun=function(NewRun){this.m_aDocumentPositions.OnEnd_SplitRun(NewRun);this.m_aForeignCursorsPos.OnEnd_SplitRun(NewRun)};CCollaborativeEditingBase.prototype.Update_DocumentPosition=function(DocPos){this.m_aDocumentPositions.Update_DocumentPosition(DocPos)};
CCollaborativeEditingBase.prototype.Update_ForeignCursorsPositions=function(){};CCollaborativeEditingBase.prototype.InitMemory=function(){if(!this.m_oMemory)this.m_oMemory=new AscCommon.CMemory};CCollaborativeEditingBase.prototype.private_SaveDocumentState=function(){var LogicDocument=editor.WordControl.m_oLogicDocument;var DocState;if(true!==this.Is_Fast()){DocState=LogicDocument.Get_SelectionState2();this.m_aCursorsToUpdate={}}else DocState=LogicDocument.Save_DocumentStateBeforeLoadChanges();return DocState};
CCollaborativeEditingBase.prototype.private_RestoreDocumentState=function(DocState){var LogicDocument=editor.WordControl.m_oLogicDocument;if(true!==this.Is_Fast())LogicDocument.Set_SelectionState2(DocState);else{LogicDocument.Load_DocumentStateAfterLoadChanges(DocState);this.Refresh_ForeignCursors()}};CCollaborativeEditingBase.prototype.WatchDocumentPositionsByState=function(DocState){this.Clear_DocumentPositions();if(DocState.Pos)this.Add_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Add_DocumentPosition(DocState.StartPos);
if(DocState.EndPos)this.Add_DocumentPosition(DocState.EndPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Add_DocumentPosition(DocState.FootnotesStart.Pos);if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Add_DocumentPosition(DocState.FootnotesStart.StartPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Add_DocumentPosition(DocState.FootnotesStart.EndPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Add_DocumentPosition(DocState.FootnotesEnd.Pos);
if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Add_DocumentPosition(DocState.FootnotesEnd.StartPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Add_DocumentPosition(DocState.FootnotesEnd.EndPos)};CCollaborativeEditingBase.prototype.UpdateDocumentPositionsByState=function(DocState){if(DocState.Pos)this.Update_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Update_DocumentPosition(DocState.StartPos);if(DocState.EndPos)this.Update_DocumentPosition(DocState.EndPos);
if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Update_DocumentPosition(DocState.FootnotesStart.Pos);if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Update_DocumentPosition(DocState.FootnotesStart.StartPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Update_DocumentPosition(DocState.FootnotesStart.EndPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Update_DocumentPosition(DocState.FootnotesEnd.Pos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Update_DocumentPosition(DocState.FootnotesEnd.StartPos);
if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Update_DocumentPosition(DocState.FootnotesEnd.EndPos)};CCollaborativeEditingBase.prototype.private_ClearChanges=function(){this.m_aChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=function(){};CCollaborativeEditingBase.prototype.private_AddOverallChange=function(oChange){return true};CCollaborativeEditingBase.prototype.private_ClearChanges=function(){this.m_aChanges=[];this.m_oOwnChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=
function(){var StartPoint=null===AscCommon.History.SavedIndex?0:AscCommon.History.SavedIndex+1;var LastPoint=-1;if(this.m_nUseType<=0)LastPoint=AscCommon.History.Points.length-1;else LastPoint=AscCommon.History.Index;for(var PointIndex=StartPoint;PointIndex<=LastPoint;PointIndex++){var Point=AscCommon.History.Points[PointIndex];for(var Index=0;Index<Point.Items.length;Index++){var Item=Point.Items[Index];this.m_oOwnChanges.push(Item.Data)}}};CCollaborativeEditingBase.prototype.private_AddOverallChange=
function(oChange,isSave){for(var nIndex=0,nCount=this.m_oOwnChanges.length;nIndex<nCount;++nIndex)if(oChange&&oChange.Merge&&false===oChange.Merge(this.m_oOwnChanges[nIndex]))return false;if(false!==isSave)this.m_aAllChanges.push(oChange);return true};CCollaborativeEditingBase.prototype.private_OnSendOwnChanges=function(arrChanges,nDeleteIndex){if(null!==nDeleteIndex)this.m_aAllChanges.length=this.m_nAllChangesSavedIndex+nDeleteIndex;else this.m_nAllChangesSavedIndex=this.m_aAllChanges.length;if(arrChanges.length>
0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges=this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length-1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange=
this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange=oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length=this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex=
0,nCount=arrChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrChanges[nIndex].CreateReverseChange();if(oReverseChange){arrReverseChanges.push(oReverseChange);oReverseChange.SetReverted(true)}}var oLogicDocument=this.m_oLogicDocument;oLogicDocument.DrawingDocument.EndTrackTable(null,true);oLogicDocument.TurnOffCheckChartSelection();var DocState=this.private_SaveDocumentState();var mapDrawings={};for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oClass=arrReverseChanges[nIndex].GetClass();
if(oClass&&oClass.parent&&oClass.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.parent.Get_Id()]=oClass.parent;arrReverseChanges[nIndex].Load();this.m_aAllChanges.push(arrReverseChanges[nIndex])}var mapDocumentContents={};var mapParagraphs={};var mapRuns={};var mapTables={};var mapGrObjects={};var mapSlides={};var mapLayouts={};var bChangedLayout=false;var bAddSlides=false;var mapAddedSlides={};for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oChange=arrReverseChanges[nIndex];
var oClass=oChange.GetClass();if(oClass instanceof AscCommonWord.CDocument||oClass instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.Paragraph)mapParagraphs[oClass.Get_Id()]=oClass;else if(oClass.IsParagraphContentElement&&true===oClass.IsParagraphContentElement()&&true===oChange.IsContentChange()&&oClass.GetParagraph()){mapParagraphs[oClass.GetParagraph().Get_Id()]=oClass.GetParagraph();if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=
oClass}else if(oClass instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.CTable)mapTables[oClass.Get_Id()]=oClass;else if(oClass instanceof AscFormat.CShape||oClass instanceof AscFormat.CImageShape||oClass instanceof AscFormat.CChartSpace||oClass instanceof AscFormat.CGroupShape||oClass instanceof AscFormat.CGraphicFrame)mapGrObjects[oClass.Get_Id()]=oClass;
else if(typeof AscCommonSlide!=="undefined")if(AscCommonSlide.Slide&&oClass instanceof AscCommonSlide.Slide)mapSlides[oClass.Get_Id()]=oClass;else if(AscCommonSlide.SlideLayout&&oClass instanceof AscCommonSlide.SlideLayout){mapLayouts[oClass.Get_Id()]=oClass;bChangedLayout=true}else if(AscCommonSlide.CPresentation&&oClass instanceof AscCommonSlide.CPresentation)if(oChange.Type===AscDFH.historyitem_Presentation_RemoveSlide||oChange.Type===AscDFH.historyitem_Presentation_AddSlide){bAddSlides=true;for(var i=
0;i<oChange.Items.length;++i)mapAddedSlides[oChange.Items[i].Get_Id()]=oChange.Items[i]}}var oHistory=AscCommon.History;oHistory.CreateNewPointForCollectChanges();if(bAddSlides)for(var i=oLogicDocument.Slides.length-1;i>-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent();if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout=
oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape=mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id());else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]=
oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing=mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun=mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex>
-1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1,false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof AscCommonWord.CDocument||oTable.Parent instanceof
AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent=mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex,1)}nContentLen=
oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph=new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter;var aSendingChanges=
[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrReverseChanges[nIndex];var oChangeClass=oReverseChange.GetClass();var nBinaryPos=oBinaryWriter.GetCurPosition();oBinaryWriter.WriteString2(oChangeClass.Get_Id());oBinaryWriter.WriteLong(oReverseChange.Type);oReverseChange.WriteToBinary(oBinaryWriter);var nBinaryLen=oBinaryWriter.GetCurPosition()-nBinaryPos;var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,oReverseChange,
{Pos:nBinaryPos,Len:nBinaryLen});aSendingChanges.push(oChange.m_pData)}var oHistoryPoint=oHistory.Points[oHistory.Points.length-1];for(var nIndex=0,nCount=oHistoryPoint.Items.length;nIndex<nCount;++nIndex){var oReverseChange=oHistoryPoint.Items[nIndex].Data;var oChangeClass=oReverseChange.GetClass();var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,oReverseChange,{Pos:oHistoryPoint.Items[nIndex].Binary.Pos,Len:oHistoryPoint.Items[nIndex].Binary.Len});aSendingChanges.push(oChange.m_pData);
arrReverseChanges.push(oHistoryPoint.Items[nIndex].Data)}oHistory.Remove_LastPoint();this.Clear_DCChanges();editor.CoAuthoringApi.saveChanges(aSendingChanges,null,null,false,this.getCollaborativeEditing());this.private_RestoreDocumentState(DocState);oLogicDocument.TurnOnCheckChartSelection();this.private_RecalculateDocument(AscCommon.History.Get_RecalcData(null,arrReverseChanges));oLogicDocument.Document_UpdateSelectionState();oLogicDocument.Document_UpdateInterfaceState();oLogicDocument.Document_UpdateRulersState()};
CCollaborativeEditingBase.prototype.CanUndo=function(){return this.m_aOwnChangesIndexes.length<=0?false:true};CCollaborativeEditingBase.prototype.private_CommutateContentChanges=function(oChange,nStartPosition){var arrActions=oChange.ConvertToSimpleActions();var arrCommutateActions=[];for(var nActionIndex=arrActions.length-1;nActionIndex>=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount=this.m_aAllChanges.length;nIndex<nOverallCount;++nIndex){var oTempChange=
this.m_aAllChanges[nIndex];if(!oTempChange)continue;if(oChange.IsRelated(oTempChange)&&true!==oTempChange.IsReverted()){var arrOtherActions=oTempChange.ConvertToSimpleActions();for(var nIndex2=0,nOtherActionsCount2=arrOtherActions.length;nIndex2<nOtherActionsCount2;++nIndex2){var oOtherAction=arrOtherActions[nIndex2];if(false===this.private_Commutate(oAction,oOtherAction)){arrOtherActions.splice(nIndex2,1);oResult=null;break}}oTempChange.ConvertFromSimpleActions(arrOtherActions)}if(!oResult)break}if(null!==
oResult)arrCommutateActions.push(oResult)}if(arrCommutateActions.length>0)oChange.ConvertFromSimpleActions(arrCommutateActions);else return false;return true};CCollaborativeEditingBase.prototype.private_Commutate=function(oActionL,oActionR){if(oActionL.Add)if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;else oActionR.Pos--;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else if(oActionL.Pos===oActionR.Pos)return false;else oActionR.Pos--;else if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;
else oActionR.Pos++;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else oActionR.Pos++;return true};CCollaborativeEditingBase.prototype.private_CommutatePropertyChanges=function(oClass,oChange,nStartPosition){if(oChange.CheckCorrect&&!oChange.CheckCorrect())return false;return true};CCollaborativeEditingBase.prototype.private_RecalculateDocument=function(oRecalcData){};function CDocumentPositionsManager(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=
[]}CDocumentPositionsManager.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=[]};CDocumentPositionsManager.prototype.Add_DocumentPosition=function(Position){this.m_aDocumentPositions.push(Position)};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex<PosCount;++PosIndex){var DocPos=this.m_aDocumentPositions[PosIndex];
for(var ClassPos=0,ClassLen=DocPos.length;ClassPos<ClassLen;++ClassPos){var _Pos=DocPos[ClassPos];if(Class===_Pos.Class&&undefined!==_Pos.Position&&(_Pos.Position>Pos||_Pos.Position===Pos&&!(Class instanceof AscCommonWord.ParaRun))){_Pos.Position++;break}}}};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnRemove=function(Class,Pos,Count){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex<PosCount;++PosIndex){var DocPos=this.m_aDocumentPositions[PosIndex];for(var ClassPos=
0,ClassLen=DocPos.length;ClassPos<ClassLen;++ClassPos){var _Pos=DocPos[ClassPos];if(Class===_Pos.Class&&undefined!==_Pos.Position){if(_Pos.Position>Pos+Count)_Pos.Position-=Count;else if(_Pos.Position>=Pos){_Pos.Position=Pos;_Pos.Deleted=true}break}}}};CDocumentPositionsManager.prototype.OnStart_SplitRun=function(SplitRun,SplitPos){this.m_aDocumentPositionsSplit=[];for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex<PosCount;++PosIndex){var DocPos=this.m_aDocumentPositions[PosIndex];
for(var ClassPos=0,ClassLen=DocPos.length;ClassPos<ClassLen;++ClassPos){var _Pos=DocPos[ClassPos];if(SplitRun===_Pos.Class&&_Pos.Position&&_Pos.Position>=SplitPos)this.m_aDocumentPositionsSplit.push({DocPos:DocPos,NewRunPos:_Pos.Position-SplitPos})}}};CDocumentPositionsManager.prototype.OnEnd_SplitRun=function(NewRun){if(!NewRun)return;for(var PosIndex=0,PosCount=this.m_aDocumentPositionsSplit.length;PosIndex<PosCount;++PosIndex){var NewDocPos=[];NewDocPos.push({Class:NewRun,Position:this.m_aDocumentPositionsSplit[PosIndex].NewRunPos});
this.m_aDocumentPositions.push(NewDocPos);this.m_aDocumentPositionsMap.push({StartPos:this.m_aDocumentPositionsSplit[PosIndex].DocPos,EndPos:NewDocPos})}};CDocumentPositionsManager.prototype.Update_DocumentPosition=function(DocPos){var NewDocPos=DocPos;for(var PosIndex=0,PosCount=this.m_aDocumentPositionsMap.length;PosIndex<PosCount;++PosIndex)if(this.m_aDocumentPositionsMap[PosIndex].StartPos===NewDocPos)NewDocPos=this.m_aDocumentPositionsMap[PosIndex].EndPos;if(NewDocPos!==DocPos&&NewDocPos.length===
1&&NewDocPos[0].Class instanceof AscCommonWord.ParaRun){var Run=NewDocPos[0].Class;var Para=Run.GetParagraph();if(AscCommonWord.CanUpdatePosition(Para,Run)){DocPos.length=0;Run.GetDocumentPositionFromObject(DocPos);DocPos.push({Class:Run,Position:NewDocPos[0].Position})}}else if(DocPos.length>0&&DocPos[DocPos.length-1].Class instanceof AscCommonWord.ParaRun){var Run=DocPos[DocPos.length-1].Class;var RunPos=DocPos[DocPos.length-1].Position;var Para=Run.GetParagraph();if(AscCommonWord.CanUpdatePosition(Para,
Run)){DocPos.length=0;Run.GetDocumentPositionFromObject(DocPos);DocPos.push({Class:Run,Position:RunPos})}}};CDocumentPositionsManager.prototype.Remove_DocumentPosition=function(DocPos){for(var Pos=0,Count=this.m_aDocumentPositions.length;Pos<Count;++Pos)if(this.m_aDocumentPositions[Pos]===DocPos){this.m_aDocumentPositions.splice(Pos,1);return}};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].FOREIGN_CURSOR_LABEL_HIDETIME=FOREIGN_CURSOR_LABEL_HIDETIME;window["AscCommon"].CCollaborativeChanges=
CCollaborativeChanges;window["AscCommon"].CCollaborativeEditingBase=CCollaborativeEditingBase;window["AscCommon"].CDocumentPositionsManager=CDocumentPositionsManager})(window);"use strict";(function(window,undefined){var g_dKoef_mm_to_pix=AscCommon.g_dKoef_mm_to_pix;function CBounds(){this.L=0;this.T=0;this.R=0;this.B=0;this.isAbsL=false;this.isAbsT=false;this.isAbsR=false;this.isAbsB=false;this.AbsW=-1;this.AbsH=-1;this.SetParams=function(_l,_t,_r,_b,abs_l,abs_t,abs_r,abs_b,absW,absH){this.L=_l;
this.T=_t;this.R=_r;this.B=_b;this.isAbsL=abs_l;this.isAbsT=abs_t;this.isAbsR=abs_r;this.isAbsB=abs_b;this.AbsW=absW;this.AbsH=absH}}function CAbsolutePosition(){this.L=0;this.T=0;this.R=0;this.B=0}var g_anchor_left=1;var g_anchor_top=2;var g_anchor_right=4;var g_anchor_bottom=8;function CControl(){this.Bounds=new CBounds;this.Anchor=g_anchor_left|g_anchor_top;this.Name=null;this.Parent=null;this.TabIndex=null;this.HtmlElement=null;this.AbsolutePosition=new CBounds;this.Resize=function(_width,_height,
api){if(null==this.Parent||null==this.HtmlElement)return;var _x=0;var _y=0;var _r=0;var _b=0;var hor_anchor=this.Anchor&5;var ver_anchor=this.Anchor&10;if(g_anchor_left==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3;if(-1!=this.Bounds.AbsW)_r=_x+this.Bounds.AbsW;else if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3}else if(g_anchor_right==hor_anchor){if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3;if(-1!=
this.Bounds.AbsW)_x=_r-this.Bounds.AbsW;else if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3}else if((g_anchor_left|g_anchor_right)==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3;if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3}else{_x=this.Bounds.L;_r=this.Bounds.R}if(g_anchor_top==ver_anchor){if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3;if(-1!=this.Bounds.AbsH)_b=_y+this.Bounds.AbsH;
else if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3}else if(g_anchor_bottom==ver_anchor){if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3;if(-1!=this.Bounds.AbsH)_y=_b-this.Bounds.AbsH;else if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3}else if((g_anchor_top|g_anchor_bottom)==ver_anchor){if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3;if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;
else _b=this.Bounds.B*_height/1E3}else{_y=this.Bounds.T;_b=this.Bounds.B}if(_r<_x)_r=_x;if(_b<_y)_b=_y;this.AbsolutePosition.L=_x;this.AbsolutePosition.T=_y;this.AbsolutePosition.R=_r;this.AbsolutePosition.B=_b;this.HtmlElement.style.left=(_x*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.top=(_y*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.width=((_r-_x)*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.height=((_b-_y)*g_dKoef_mm_to_pix+.5>>0)+"px";if(api!==undefined&&api.CheckRetinaElement&&
api.CheckRetinaElement(this.HtmlElement)){var _W=(_r-_x)*g_dKoef_mm_to_pix+.5>>0;var _H=(_b-_y)*g_dKoef_mm_to_pix+.5>>0;this.HtmlElement.width=AscCommon.AscBrowser.convertToRetinaValue(_W,true);this.HtmlElement.height=AscCommon.AscBrowser.convertToRetinaValue(_H,true)}else{this.HtmlElement.width=(_r-_x)*g_dKoef_mm_to_pix+.5>>0;this.HtmlElement.height=(_b-_y)*g_dKoef_mm_to_pix+.5>>0}};this.GetCSS_width=function(){return(this.AbsolutePosition.R-this.AbsolutePosition.L)*g_dKoef_mm_to_pix+.5>>0};this.GetCSS_height=
function(){return(this.AbsolutePosition.B-this.AbsolutePosition.T)*g_dKoef_mm_to_pix+.5>>0}}function CControlContainer(){this.Bounds=new CBounds;this.Anchor=g_anchor_left|g_anchor_top;this.Name=null;this.Parent=null;this.TabIndex=null;this.HtmlElement=null;this.AbsolutePosition=new CBounds;this.Controls=[];this.AddControl=function(ctrl){ctrl.Parent=this;this.Controls[this.Controls.length]=ctrl};this.Resize=function(_width,_height,api){if(null==this.Parent){this.AbsolutePosition.L=0;this.AbsolutePosition.T=
0;this.AbsolutePosition.R=_width;this.AbsolutePosition.B=_height;if(null!=this.HtmlElement){var lCount=this.Controls.length;for(var i=0;i<lCount;i++)this.Controls[i].Resize(_width,_height,api)}return}var _x=0;var _y=0;var _r=0;var _b=0;var hor_anchor=this.Anchor&5;var ver_anchor=this.Anchor&10;if(g_anchor_left==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3;if(-1!=this.Bounds.AbsW)_r=_x+this.Bounds.AbsW;else if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=
this.Bounds.R*_width/1E3}else if(g_anchor_right==hor_anchor){if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3;if(-1!=this.Bounds.AbsW)_x=_r-this.Bounds.AbsW;else if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3}else if((g_anchor_left|g_anchor_right)==hor_anchor){if(this.Bounds.isAbsL)_x=this.Bounds.L;else _x=this.Bounds.L*_width/1E3;if(this.Bounds.isAbsR)_r=_width-this.Bounds.R;else _r=this.Bounds.R*_width/1E3}else{_x=this.Bounds.L;_r=this.Bounds.R}if(g_anchor_top==
ver_anchor){if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3;if(-1!=this.Bounds.AbsH)_b=_y+this.Bounds.AbsH;else if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3}else if(g_anchor_bottom==ver_anchor){if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3;if(-1!=this.Bounds.AbsH)_y=_b-this.Bounds.AbsH;else if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3}else if((g_anchor_top|g_anchor_bottom)==
ver_anchor){if(this.Bounds.isAbsT)_y=this.Bounds.T;else _y=this.Bounds.T*_height/1E3;if(this.Bounds.isAbsB)_b=_height-this.Bounds.B;else _b=this.Bounds.B*_height/1E3}else{_y=this.Bounds.T;_b=this.Bounds.B}if(_r<_x)_r=_x;if(_b<_y)_b=_y;this.AbsolutePosition.L=_x;this.AbsolutePosition.T=_y;this.AbsolutePosition.R=_r;this.AbsolutePosition.B=_b;this.HtmlElement.style.left=(_x*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.top=(_y*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.width=((_r-_x)*
g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.height=((_b-_y)*g_dKoef_mm_to_pix+.5>>0)+"px";var lCount=this.Controls.length;for(var i=0;i<lCount;i++)this.Controls[i].Resize(_r-_x,_b-_y,api)};this.GetCSS_width=function(){return(this.AbsolutePosition.R-this.AbsolutePosition.L)*g_dKoef_mm_to_pix+.5>>0};this.GetCSS_height=function(){return(this.AbsolutePosition.B-this.AbsolutePosition.T)*g_dKoef_mm_to_pix+.5>>0}}function CreateControlContainer(name){var ctrl=new CControlContainer;ctrl.Name=name;
ctrl.HtmlElement=document.getElementById(name);return ctrl}function CreateControl(name){var ctrl=new CControl;ctrl.Name=name;ctrl.HtmlElement=document.getElementById(name);return ctrl}window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].g_anchor_left=g_anchor_left;window["AscCommon"].g_anchor_top=g_anchor_top;window["AscCommon"].g_anchor_right=g_anchor_right;window["AscCommon"].g_anchor_bottom=g_anchor_bottom;window["AscCommon"].CreateControlContainer=CreateControlContainer;window["AscCommon"].CreateControl=
CreateControl})(window);"use strict";(function(window,undefined){var AscBrowser=AscCommon.AscBrowser;var TRACK_CIRCLE_RADIUS=5;var TRACK_RECT_SIZE2=4;var TRACK_RECT_SIZE=8;var TRACK_RECT_SIZE_CT=6;var TRACK_DISTANCE_ROTATE=25;var TRACK_DISTANCE_ROTATE2=25;var TRACK_ADJUSTMENT_SIZE=10;var TRACK_WRAPPOINTS_SIZE=6;var IMAGE_ROTATE_TRACK_W=21;var bIsUseImageRotateTrack=true;if(bIsUseImageRotateTrack){window.g_track_rotate_marker=new Image;window.g_track_rotate_marker;window.g_track_rotate_marker.asc_complete=
false;window.g_track_rotate_marker.onload=function(){window.g_track_rotate_marker.asc_complete=true};window.g_track_rotate_marker.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAAVFBMVEUAAAD///////////////////////////////////////////////////////98fHy2trb09PTT09OysrKqqqqJiYng4ODr6+uamprGxsbi4uKGhoYjgM0eAAAADnRSTlMAy00k7/z0jbeuMzDljsugwZgAAACpSURBVBjTdZHbEoMgDESDAl6bgIqX9v//s67UYpm6D0xyYMImoaiuUr3pVdVRUtnwqaY8YaE5SRcfaPgqc+DSIh7WIGGaEVoUqRGN4oZlcDIiqYlaPjQz5CNu6cFJwLiuSO3nlLBDrKhn3l4rcnH4NcAdGd5EZMfCsoMFBxM6CD57G+u6vC48PMVnHtrYhP/x+7+3cw7zdJnD3cyA7QXa4nYXaW+a9Xdvb6zqE5Jb7LmzAAAAAElFTkSuQmCC";
window.g_track_rotate_marker2=new Image;window.g_track_rotate_marker2;window.g_track_rotate_marker2.asc_complete=false;window.g_track_rotate_marker2.onload=function(){window.g_track_rotate_marker2.asc_complete=true};window.g_track_rotate_marker2.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAeFBMVEUAAAD///////////////////////////////////////////////////////////////////////////+Tk5Obm5v8/PzAwMD5+fmWlpbt7e3k5OSfn5/z8/PLy8vn5+fExMSsrKyqqqrf39+vr6+9vb2urq7c3NxSmuRpAAAAE3RSTlMA+u2XA+PTrId4WBwTN7EKtLY4iqQP6AAAAWhJREFUOMudVe2SgjAMLN+goN51CxTLp3r3/m943BAqIJTR/RU6O02yTRY2g5tEgW9blu0HUeKyLRxDj0/ghcdVWuxYfAHLiV95B5uvwD4saK7DN+DMSj1f+CYu58l9J27A6XnnJG9R3ZWU6l4Vk+y6D310baHRXvUxdRSP/aYZILJbmebFLRNAlo69x7PEeQdZ5Xz8qiS6fJr8aOnEquATFApdSsr/v1HINUo+Q6nwoDDspfH4JmoJ6shzWcINaNBSlLCI6uvLfyXmAlR2xIKBB/A1ZKiGIGA+8QCtphBawRt+hsBnNvE0M0OPZmwcijRnFvE0U6CuIcbrIUlJRnJL9L0YifTQCgU3p/aH4I7fnWaCIajwMMszCl5A7Aj+TWctGuMT6qG4QtbGodBj9oAyjpke3LSDYXCXq9A8V6GZrsLGcqXlcrneW9elAQgpxdwA3rcUdv4ymdQHtrdvpPvW/LHZ7/8+/gBTWGFPbAkGiAAAAABJRU5ErkJggg==";
TRACK_DISTANCE_ROTATE2=18}function COverlay(){this.m_oControl=null;this.m_oContext=null;this.min_x=65535;this.min_y=65535;this.max_x=-65535;this.max_y=-65535;this.m_bIsShow=false;this.m_bIsAlwaysUpdateOverlay=false;this.m_oHtmlPage=null;this.DashLineColor="#000000";this.ClearAll=false;this.IsRetina=false;this.IsCellEditor=false}COverlay.prototype={init:function(context,controlName,x,y,w_pix,h_pix,w_mm,h_mm){this.m_oContext=context;this.m_oControl=AscCommon.CreateControl(controlName);this.m_oHtmlPage=
new AscCommon.CHtmlPage;this.m_oHtmlPage.init(x,y,w_pix,h_pix,w_mm,h_mm)},Clear:function(){if(null==this.m_oContext){this.m_oContext=this.m_oControl.HtmlElement.getContext("2d");this.m_oContext.imageSmoothingEnabled=false;this.m_oContext.mozImageSmoothingEnabled=false;this.m_oContext.oImageSmoothingEnabled=false;this.m_oContext.webkitImageSmoothingEnabled=false}this.SetBaseTransform();this.m_oContext.beginPath();if(this.max_x!=-65535&&this.max_y!=-65535)if(this.ClearAll===true){this.m_oContext.clearRect(0,

View File

@ -266,13 +266,13 @@ editorType;this._isExcel=c_oEditorId.Spreadsheet===editorType;this._isPresentati
docid;this.sockjs_url=AscCommon.getBaseUrl()+"../../../../doc/"+docid+"/c"};DocsCoApi.prototype.auth=function(isViewer,opt_openCmd,opt_isIdle){this._isViewer=isViewer;if(this._locks){this.ownedLockBlocks=[];for(var block in this._locks)if(this._locks.hasOwnProperty(block)){var lock=this._locks[block];if(lock["state"]===2)this.ownedLockBlocks.push(lock["blockValue"])}this._locks={}}this._send({"type":"auth","docid":this._docid,"documentCallbackUrl":this._documentCallbackUrl,"token":this._token,"user":{"id":this._user.asc_getId(),
"username":this._user.asc_getUserName(),"firstname":this._user.asc_getFirstName(),"lastname":this._user.asc_getLastName(),"indexUser":this._indexUser},"editorType":this.editorType,"lastOtherSaveTime":this.lastOtherSaveTime,"block":this.ownedLockBlocks,"sessionId":this._id,"sessionTimeConnect":this._sessionTimeConnect,"sessionTimeIdle":opt_isIdle>=0?opt_isIdle:0,"documentFormatSave":this._documentFormatSave,"view":this._isViewer,"isCloseCoAuthoring":this.isCloseCoAuthoring,"openCmd":opt_openCmd,"lang":this.lang,
"mode":this.mode,"permissions":this.permissions,"encrypted":this.encrypted,"jwtOpen":this.jwtOpen,"jwtSession":this.jwtSession})};DocsCoApi.prototype._initSocksJs=function(){var t=this;var sockjs;sockjs=this.sockjs={};var send=function(data){setTimeout(function(){sockjs.onmessage({data:JSON.stringify(data)})})};var license={type:"license",license:{type:3,mode:0,rights:1,buildVersion:"5.2.6",buildNumber:2}};var channel;require(["/common/outer/worker-channel.js","/common/common-util.js"],function(Channel,
Util){var msgEv=Util.mkEvent();var p=window.parent;window.addEventListener("message",function(msg){if(msg.source!==p)return;msgEv.fire(msg)});var postMsg=function(data){p.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){channel=chan;send(license);chan.on("CMD",function(obj){send(obj)})})});sockjs.onopen=function(){t._state=ConnectionState.WaitAuth;t.onFirstConnect()};sockjs.onopen();sockjs.close=function(){console.error("Close realtime")};sockjs.send=function(data){try{var obj=JSON.parse(data)}catch(e){console.error(e);
return}if(channel)channel.event("CMD",obj)};sockjs.onmessage=function(e){t._onServerMessage(e.data)};return sockjs};DocsCoApi.prototype._onServerOpen=function(){if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=null;this.attemptCount=0}this._state=ConnectionState.WaitAuth;this.onFirstConnect()};DocsCoApi.prototype._onServerMessage=function(data){var dataObject=JSON.parse(data);switch(dataObject["type"]){case "auth":this._onAuth(dataObject);break;case "message":this._onMessages(dataObject,
false);break;case "cursor":this._onCursor(dataObject);break;case "meta":this._onMeta(dataObject);break;case "getLock":this._onGetLock(dataObject);break;case "releaseLock":this._onReleaseLock(dataObject);break;case "connectState":this._onConnectionStateChanged(dataObject);break;case "saveChanges":this._onSaveChanges(dataObject);break;case "authChanges":this._onAuthChanges(dataObject);break;case "saveLock":this._onSaveLock(dataObject);break;case "unSaveLock":this._onUnSaveLock(dataObject);break;case "savePartChanges":this._onSavePartChanges(dataObject);
break;case "drop":this._onDrop(dataObject);break;case "waitAuth":break;case "error":this._onDrop(dataObject);break;case "documentOpen":this._documentOpen(dataObject);break;case "warning":this._onWarning(dataObject);break;case "license":this._onLicense(dataObject);break;case "session":this._onSession(dataObject);break;case "refreshToken":this._onRefreshToken(dataObject["messages"]);break;case "expiredToken":this._onExpiredToken(dataObject);break;case "forceSaveStart":this._onForceSaveStart(dataObject["messages"]);
break;case "forceSave":this._onForceSave(dataObject["messages"]);break}};DocsCoApi.prototype._onServerClose=function(evt){if(ConnectionState.SaveChanges===this._state){this._isReSaveAfterAuth=true;if(null!==this.saveCallbackErrorTimeOutId){clearTimeout(this.saveCallbackErrorTimeOutId);this.saveCallbackErrorTimeOutId=null}}this._state=ConnectionState.Reconnect;var bIsDisconnectAtAll=c_oCloseCode.serverShutdown<=evt.code&&evt.code<=c_oCloseCode.drop||this.attemptCount>=this.maxAttemptCount;var code=
null;if(bIsDisconnectAtAll){this._state=ConnectionState.ClosedAll;code=evt.code}if(this.onDisconnect)this.onDisconnect(evt.reason,code);if(!bIsDisconnectAtAll)this._tryReconnect()};DocsCoApi.prototype._reconnect=function(){delete this.sockjs;this._initSocksJs()};DocsCoApi.prototype._tryReconnect=function(){var t=this;if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);t.reconnectTimeout=null}++this.attemptCount;this.reconnectTimeout=setTimeout(function(){t._reconnect()},this.reconnectInterval)};
window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDocsCoApi=CDocsCoApi})(window);"use strict";
Util){var msgEv=Util.mkEvent();var p=window.parent;if(editor.isReporterMode){p=window.opener;window.parent=p}else window.APP=p&&p.APP;window.addEventListener("message",function(msg){if(msg.source!==p)return;msgEv.fire(msg)});var postMsg=function(data){p.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){channel=chan;send(license);chan.on("CMD",function(obj){send(obj)})})});sockjs.onopen=function(){t._state=ConnectionState.WaitAuth;t.onFirstConnect()};sockjs.onopen();sockjs.close=function(){console.error("Close realtime")};
sockjs.send=function(data){try{var obj=JSON.parse(data)}catch(e){console.error(e);return}if(channel)channel.event("CMD",obj)};sockjs.onmessage=function(e){t._onServerMessage(e.data)};return sockjs};DocsCoApi.prototype._onServerOpen=function(){if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=null;this.attemptCount=0}this._state=ConnectionState.WaitAuth;this.onFirstConnect()};DocsCoApi.prototype._onServerMessage=function(data){var dataObject=JSON.parse(data);switch(dataObject["type"]){case "auth":this._onAuth(dataObject);
break;case "message":this._onMessages(dataObject,false);break;case "cursor":this._onCursor(dataObject);break;case "meta":this._onMeta(dataObject);break;case "getLock":this._onGetLock(dataObject);break;case "releaseLock":this._onReleaseLock(dataObject);break;case "connectState":this._onConnectionStateChanged(dataObject);break;case "saveChanges":this._onSaveChanges(dataObject);break;case "authChanges":this._onAuthChanges(dataObject);break;case "saveLock":this._onSaveLock(dataObject);break;case "unSaveLock":this._onUnSaveLock(dataObject);
break;case "savePartChanges":this._onSavePartChanges(dataObject);break;case "drop":this._onDrop(dataObject);break;case "waitAuth":break;case "error":this._onDrop(dataObject);break;case "documentOpen":this._documentOpen(dataObject);break;case "warning":this._onWarning(dataObject);break;case "license":this._onLicense(dataObject);break;case "session":this._onSession(dataObject);break;case "refreshToken":this._onRefreshToken(dataObject["messages"]);break;case "expiredToken":this._onExpiredToken(dataObject);
break;case "forceSaveStart":this._onForceSaveStart(dataObject["messages"]);break;case "forceSave":this._onForceSave(dataObject["messages"]);break}};DocsCoApi.prototype._onServerClose=function(evt){if(ConnectionState.SaveChanges===this._state){this._isReSaveAfterAuth=true;if(null!==this.saveCallbackErrorTimeOutId){clearTimeout(this.saveCallbackErrorTimeOutId);this.saveCallbackErrorTimeOutId=null}}this._state=ConnectionState.Reconnect;var bIsDisconnectAtAll=c_oCloseCode.serverShutdown<=evt.code&&evt.code<=
c_oCloseCode.drop||this.attemptCount>=this.maxAttemptCount;var code=null;if(bIsDisconnectAtAll){this._state=ConnectionState.ClosedAll;code=evt.code}if(this.onDisconnect)this.onDisconnect(evt.reason,code);if(!bIsDisconnectAtAll)this._tryReconnect()};DocsCoApi.prototype._reconnect=function(){delete this.sockjs;this._initSocksJs()};DocsCoApi.prototype._tryReconnect=function(){var t=this;if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);t.reconnectTimeout=null}++this.attemptCount;this.reconnectTimeout=
setTimeout(function(){t._reconnect()},this.reconnectInterval)};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDocsCoApi=CDocsCoApi})(window);"use strict";
(function(window){var CSpellCheckApi=function(){this._SpellCheckApi=new SpellCheckApi;this._onlineWork=false;this.onDisconnect=null;this.onSpellCheck=null};CSpellCheckApi.prototype.init=function(docid){if(this._SpellCheckApi&&this._SpellCheckApi.isRightURL()){var t=this;this._SpellCheckApi.onDisconnect=function(e,isDisconnectAtAll,isCloseCoAuthoring){t.callback_OnDisconnect(e,isDisconnectAtAll,isCloseCoAuthoring)};this._SpellCheckApi.onSpellCheck=function(e){t.callback_OnSpellCheck(e)};this._SpellCheckApi.onInit=
function(e){t.callback_OnInit(e)};this._SpellCheckApi.init(docid);this._onlineWork=true}};CSpellCheckApi.prototype.set_url=function(url){if(this._SpellCheckApi)this._SpellCheckApi.set_url(url)};CSpellCheckApi.prototype.get_state=function(){if(this._SpellCheckApi)return this._SpellCheckApi.get_state();return 0};CSpellCheckApi.prototype.disconnect=function(){if(this._SpellCheckApi&&this._onlineWork)this._SpellCheckApi.disconnect()};CSpellCheckApi.prototype.spellCheck=function(spellCheckData){if(this._SpellCheckApi&&
this._onlineWork)this._SpellCheckApi.spellCheck(spellCheckData)};CSpellCheckApi.prototype.checkDictionary=function(lang){if(this._SpellCheckApi&&this._onlineWork)return this._SpellCheckApi.checkDictionary(lang);return true};CSpellCheckApi.prototype.callback_OnSpellCheck=function(e){if(this.onSpellCheck)return this.onSpellCheck(e)};CSpellCheckApi.prototype.callback_OnInit=function(e){if(this.onInit)return this.onInit(e)};CSpellCheckApi.prototype.callback_OnDisconnect=function(e,isDisconnectAtAll,isCloseCoAuthoring){if(this.onDisconnect)return this.onDisconnect(e,
@ -1356,62 +1356,62 @@ prot["Clock_Clockwise"]=c_oAscSlideTransitionParams.Clock_Clockwise;prot["Clock_
prot["EditSelectAll"]=c_oAscPresentationShortcutType.EditSelectAll;prot["EditUndo"]=c_oAscPresentationShortcutType.EditUndo;prot["EditRedo"]=c_oAscPresentationShortcutType.EditRedo;prot["Cut"]=c_oAscPresentationShortcutType.Cut;prot["Copy"]=c_oAscPresentationShortcutType.Copy;prot["Paste"]=c_oAscPresentationShortcutType.Paste;prot["Duplicate"]=c_oAscPresentationShortcutType.Duplicate;prot["Print"]=c_oAscPresentationShortcutType.Print;prot["Save"]=c_oAscPresentationShortcutType.Save;
prot["ShowContextMenu"]=c_oAscPresentationShortcutType.ShowContextMenu;window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].c_oSerFormat=c_oSerFormat;window["AscCommon"].CurFileVersion=c_oSerFormat.Version;"use strict";
(function(window,undefined){var FOREIGN_CURSOR_LABEL_HIDETIME=1500;function CCollaborativeChanges(){this.m_pData=null;this.m_oColor=null}CCollaborativeChanges.prototype.Set_Data=function(pData){this.m_pData=pData};CCollaborativeChanges.prototype.Set_Color=function(oColor){this.m_oColor=oColor};CCollaborativeChanges.prototype.Set_FromUndoRedo=function(Class,Data,Binary){if(!Class.Get_Id)return false;this.m_pData=this.private_SaveData(Binary);return true};CCollaborativeChanges.prototype.Apply_Data=
function(){var CollaborativeEditing=AscCommon.CollaborativeEditing;var Reader=this.private_LoadData(this.m_pData);var ClassId=Reader.GetString2();var Class=AscCommon.g_oTableId.Get_ById(ClassId);if(!Class)return false;var nReaderPos=Reader.GetCurPos();var nChangesType=Reader.GetLong();var fChangesClass=AscDFH.changesFactory[nChangesType];if(fChangesClass){var oChange=new fChangesClass(Class);oChange.ReadFromBinary(Reader);if(true===CollaborativeEditing.private_AddOverallChange(oChange))oChange.Load(this.m_oColor);
return true}else{CollaborativeEditing.private_AddOverallChange(this.m_pData);Reader.Seek2(nReaderPos);if(!Class.Load_Changes)return false;return Class.Load_Changes(Reader,null,this.m_oColor)}};CCollaborativeChanges.prototype.private_LoadData=function(szSrc){return this.GetStream(szSrc,0,szSrc.length)};CCollaborativeChanges.prototype.GetStream=function(szSrc,offset,srcLen){var nWritten=0;var index=-1+offset;var dst_len="";while(true){index++;var _c=szSrc.charCodeAt(index);if(_c==";".charCodeAt(0)){index++;
break}dst_len+=String.fromCharCode(_c)}var dstLen=parseInt(dst_len);var pointer=AscFonts.g_memory.Alloc(dstLen);var stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var dstPx=stream.data;if(window.chrome)while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&
16711680)>>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len;
return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_bGlobalLock=0;this.m_bGlobalLockSelection=0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId=
{};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex=0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes=[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=
[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors();this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast=function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing=
function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType=0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)};CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index<Len;Index++)if(this.m_aUsers[Index]===
UserId)return Index;return-1};CCollaborativeEditingBase.prototype.Remove_User=function(UserId){var Pos=this.Find_User(UserId);if(-1!=Pos)this.m_aUsers.splice(Pos,1)};CCollaborativeEditingBase.prototype.Add_Changes=function(Changes){this.m_aChanges.push(Changes)};CCollaborativeEditingBase.prototype.Add_Unlock=function(LockClass){this.m_aNeedUnlock.push(LockClass)};CCollaborativeEditingBase.prototype.Add_Unlock2=function(Lock){this.m_aNeedUnlock2.push(Lock);editor._onUpdateDocumentCanSave()};CCollaborativeEditingBase.prototype.Have_OtherChanges=
function(){return 0<this.m_aChanges.length};CCollaborativeEditingBase.prototype.Apply_Changes=function(){var OtherChanges=this.m_aChanges.length>0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate();editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult();editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges();
this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length>0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length;for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i];
Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length};CCollaborativeEditingBase.prototype.Send_Changes=function(){};CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges=
function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i<aImages.length;++i)rData["data"].push(aImages[i]);var aImagesToLoad=[].concat(AscCommon.CollaborativeEditing.m_aNewImages);this.CheckWaitingImages(aImagesToLoad);AscCommon.CollaborativeEditing.m_aNewImages.length=0;if(false===oApi.isSaveFonts_Images)oApi.isSaveFonts_Images=true;AscCommon.CollaborativeEditing.SendImagesCallback(aImagesToLoad)};CCollaborativeEditingBase.prototype.SendImagesCallback=
function(aImages){var oApi=editor||Asc["editor"];oApi.pre_Save(aImages)};CCollaborativeEditingBase.prototype.CollectImagesFromChanges=function(){var oApi=editor||Asc["editor"];var aImages=[],sImagePath,i,sImageFromChanges,oThemeUrls={};var aNewImages=this.m_aNewImages;var oMap={};for(i=0;i<aNewImages.length;++i){sImageFromChanges=aNewImages[i];if(oMap[sImageFromChanges])continue;oMap[sImageFromChanges]=1;if(sImageFromChanges.indexOf("theme")===0&&oApi.ThemeLoader)oThemeUrls[sImageFromChanges]=oApi.ThemeLoader.ThemesUrlAbs+
sImageFromChanges;else if(0===sImageFromChanges.indexOf("http:")||0===sImageFromChanges.indexOf("data:")||0===sImageFromChanges.indexOf("https:")||0===sImageFromChanges.indexOf("file:")||0===sImageFromChanges.indexOf("ftp:"));else{sImagePath=AscCommon.g_oDocumentUrls.mediaPrefix+sImageFromChanges;if(!AscCommon.g_oDocumentUrls.getUrl(sImagePath))aImages.push(sImagePath)}}AscCommon.g_oDocumentUrls.addUrls(oThemeUrls);return aImages};CCollaborativeEditingBase.prototype.OnStart_Load_Objects=function(){this.Set_GlobalLock(true);
this.Set_GlobalLockSelection(true);var aImages=this.CollectImagesFromChanges();if(aImages.length>0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages));this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData=function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})};
CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aLinkData[Index];Item.Class.Load_LinkData(Item.LinkData)}this.Clear_LinkData()};CCollaborativeEditingBase.prototype.Check_MergeData=function(){};CCollaborativeEditingBase.prototype.Get_GlobalLock=function(){return 0===this.m_bGlobalLock?false:true};CCollaborativeEditingBase.prototype.Set_GlobalLock=function(isLock){if(isLock)this.m_bGlobalLock++;else this.m_bGlobalLock=
Math.max(0,this.m_bGlobalLock-1)};CCollaborativeEditingBase.prototype.Set_GlobalLockSelection=function(isLock){if(isLock)this.m_bGlobalLockSelection++;else this.m_bGlobalLockSelection=Math.max(0,this.m_bGlobalLockSelection-1)};CCollaborativeEditingBase.prototype.Get_GlobalLockSelection=function(){return 0===this.m_bGlobalLockSelection?false:true};CCollaborativeEditingBase.prototype.OnStart_CheckLock=function(){this.m_aCheckLocks.length=0;this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.Add_CheckLock=
function(oItem){this.m_aCheckLocks.push(oItem);this.m_aCheckLocksInstance.push(oItem)};CCollaborativeEditingBase.prototype.OnEnd_CheckLock=function(){};CCollaborativeEditingBase.prototype.OnCallback_AskLock=function(result){};CCollaborativeEditingBase.prototype.OnStartCheckLockInstance=function(){this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.OnEndCheckLockInstance=function(){var isLocked=false;for(var nIndex=0,nCount=this.m_aCheckLocksInstance.length;nIndex<nCount;++nIndex)if(true===
this.m_aCheckLocksInstance[nIndex]){isLocked=true;break}if(isLocked){var nCount=this.m_aCheckLocksInstance.length;this.m_aCheckLocks.splice(this.m_aCheckLocks.length-nCount,nCount)}this.m_aCheckLocksInstance.length=0;return isLocked};CCollaborativeEditingBase.prototype.Reset_NeedLock=function(){this.m_aNeedLock={}};CCollaborativeEditingBase.prototype.Add_NeedLock=function(Id,sUser){this.m_aNeedLock[Id]=sUser};CCollaborativeEditingBase.prototype.Remove_NeedLock=function(Id){delete this.m_aNeedLock[Id]};
CCollaborativeEditingBase.prototype.Lock_NeedLock=function(){for(var Id in this.m_aNeedLock){var Class=AscCommon.g_oTableId.Get_ById(Id);if(null!=Class){var Lock=Class.Lock;Lock.Set_Type(AscCommon.locktype_Other,false);if(Class.getObjectType&&Class.getObjectType()===AscDFH.historyitem_type_Slide)editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide&&editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide(Class.num);Lock.Set_UserId(this.m_aNeedLock[Id])}}this.Reset_NeedLock()};CCollaborativeEditingBase.prototype.Clear_NewObjects=
function(){this.m_aNewObjects.length=0};CCollaborativeEditingBase.prototype.Add_NewObject=function(Class){this.m_aNewObjects.push(Class);Class.FromBinary=true};CCollaborativeEditingBase.prototype.Clear_EndActions=function(){this.m_aEndActions.length=0};CCollaborativeEditingBase.prototype.Add_EndActions=function(Class,Data){this.m_aEndActions.push({Class:Class,Data:Data})};CCollaborativeEditingBase.prototype.OnEnd_ReadForeignChanges=function(){var Count=this.m_aNewObjects.length;for(var Index=0;Index<
Count;Index++){var Class=this.m_aNewObjects[Index];Class.FromBinary=false}Count=this.m_aEndActions.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aEndActions[Index];Item.Class.Process_EndLoad(Item.Data)}this.Clear_EndActions();this.Clear_NewObjects()};CCollaborativeEditingBase.prototype.Clear_NewImages=function(){this.m_aNewImages.length=0};CCollaborativeEditingBase.prototype.Add_NewImage=function(Url){this.m_aNewImages.push(Url)};CCollaborativeEditingBase.prototype.Add_NewDC=function(Class){var Id=
Class.Get_Id();this.m_aDC[Id]=Class};CCollaborativeEditingBase.prototype.Clear_DCChanges=function(){for(var Id in this.m_aDC)this.m_aDC[Id].Clear_ContentChanges();this.m_aDC={}};CCollaborativeEditingBase.prototype.Refresh_DCChanges=function(){for(var Id in this.m_aDC)this.m_aDC[Id].Refresh_ContentChanges();this.Clear_DCChanges()};CCollaborativeEditingBase.prototype.AddPosExtChanges=function(Item,ChangeObject){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=function(){};CCollaborativeEditingBase.prototype.RewritePosExtChanges=
function(changesArr,scale,Binary_Writer){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=function(){};CCollaborativeEditingBase.prototype.Add_ChangedClass=function(Class){var Id=Class.Get_Id();this.m_aChangedClasses[Id]=Class};CCollaborativeEditingBase.prototype.Clear_CollaborativeMarks=function(bRepaint){for(var Id in this.m_aChangedClasses)this.m_aChangedClasses[Id].Clear_CollaborativeMarks();this.m_aChangedClasses={};if(true===bRepaint){editor.WordControl.m_oLogicDocument.DrawingDocument.ClearCachePages();
editor.WordControl.m_oLogicDocument.DrawingDocument.FirePaint()}};CCollaborativeEditingBase.prototype.Add_ForeignCursorToUpdate=function(UserId,CursorInfo,UserShortId){this.m_aCursorsToUpdate[UserId]=CursorInfo;this.m_aCursorsToUpdateShortId[UserId]=UserShortId};CCollaborativeEditingBase.prototype.Refresh_ForeignCursors=function(){if(!this.m_oLogicDocument)return;for(var UserId in this.m_aCursorsToUpdate){var CursorInfo=this.m_aCursorsToUpdate[UserId];this.m_oLogicDocument.Update_ForeignCursor(CursorInfo,
UserId,false,this.m_aCursorsToUpdateShortId[UserId]);if(this.Add_ForeignCursorToShow)this.Add_ForeignCursorToShow(UserId)}this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={}};CCollaborativeEditingBase.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions.Clear_DocumentPositions()};CCollaborativeEditingBase.prototype.Add_DocumentPosition=function(DocumentPos){this.m_aDocumentPositions.Add_DocumentPosition(DocumentPos)};CCollaborativeEditingBase.prototype.Add_ForeignCursor=
function(UserId,DocumentPos,UserShortId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);this.m_aForeignCursors[UserId]=DocumentPos;this.m_aForeignCursorsPos.Add_DocumentPosition(DocumentPos);this.m_aForeignCursorsId[UserId]=UserShortId};CCollaborativeEditingBase.prototype.Remove_ForeignCursor=function(UserId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);delete this.m_aForeignCursors[UserId]};CCollaborativeEditingBase.prototype.Remove_AllForeignCursors=
function(){};CCollaborativeEditingBase.prototype.RemoveMyCursorFromOthers=function(){};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){this.m_aDocumentPositions.Update_DocumentPositionsOnAdd(Class,Pos);this.m_aForeignCursorsPos.Update_DocumentPositionsOnAdd(Class,Pos)};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnRemove=function(Class,Pos,Count){this.m_aDocumentPositions.Update_DocumentPositionsOnRemove(Class,Pos,Count);this.m_aForeignCursorsPos.Update_DocumentPositionsOnRemove(Class,
Pos,Count)};CCollaborativeEditingBase.prototype.OnStart_SplitRun=function(SplitRun,SplitPos){this.m_aDocumentPositions.OnStart_SplitRun(SplitRun,SplitPos);this.m_aForeignCursorsPos.OnStart_SplitRun(SplitRun,SplitPos)};CCollaborativeEditingBase.prototype.OnEnd_SplitRun=function(NewRun){this.m_aDocumentPositions.OnEnd_SplitRun(NewRun);this.m_aForeignCursorsPos.OnEnd_SplitRun(NewRun)};CCollaborativeEditingBase.prototype.Update_DocumentPosition=function(DocPos){this.m_aDocumentPositions.Update_DocumentPosition(DocPos)};
CCollaborativeEditingBase.prototype.Update_ForeignCursorsPositions=function(){};CCollaborativeEditingBase.prototype.InitMemory=function(){if(!this.m_oMemory)this.m_oMemory=new AscCommon.CMemory};CCollaborativeEditingBase.prototype.private_SaveDocumentState=function(){var LogicDocument=editor.WordControl.m_oLogicDocument;var DocState;if(true!==this.Is_Fast()){DocState=LogicDocument.Get_SelectionState2();this.m_aCursorsToUpdate={}}else DocState=LogicDocument.Save_DocumentStateBeforeLoadChanges();return DocState};
CCollaborativeEditingBase.prototype.private_RestoreDocumentState=function(DocState){var LogicDocument=editor.WordControl.m_oLogicDocument;if(true!==this.Is_Fast())LogicDocument.Set_SelectionState2(DocState);else{LogicDocument.Load_DocumentStateAfterLoadChanges(DocState);this.Refresh_ForeignCursors()}};CCollaborativeEditingBase.prototype.WatchDocumentPositionsByState=function(DocState){this.Clear_DocumentPositions();if(DocState.Pos)this.Add_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Add_DocumentPosition(DocState.StartPos);
if(DocState.EndPos)this.Add_DocumentPosition(DocState.EndPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Add_DocumentPosition(DocState.FootnotesStart.Pos);if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Add_DocumentPosition(DocState.FootnotesStart.StartPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Add_DocumentPosition(DocState.FootnotesStart.EndPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Add_DocumentPosition(DocState.FootnotesEnd.Pos);
if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Add_DocumentPosition(DocState.FootnotesEnd.StartPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Add_DocumentPosition(DocState.FootnotesEnd.EndPos)};CCollaborativeEditingBase.prototype.UpdateDocumentPositionsByState=function(DocState){if(DocState.Pos)this.Update_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Update_DocumentPosition(DocState.StartPos);if(DocState.EndPos)this.Update_DocumentPosition(DocState.EndPos);
if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Update_DocumentPosition(DocState.FootnotesStart.Pos);if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Update_DocumentPosition(DocState.FootnotesStart.StartPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Update_DocumentPosition(DocState.FootnotesStart.EndPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Update_DocumentPosition(DocState.FootnotesEnd.Pos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Update_DocumentPosition(DocState.FootnotesEnd.StartPos);
if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Update_DocumentPosition(DocState.FootnotesEnd.EndPos)};CCollaborativeEditingBase.prototype.private_ClearChanges=function(){this.m_aChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=function(){};CCollaborativeEditingBase.prototype.private_AddOverallChange=function(oChange){return true};CCollaborativeEditingBase.prototype.private_ClearChanges=function(){this.m_aChanges=[];this.m_oOwnChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=
function(){var StartPoint=null===AscCommon.History.SavedIndex?0:AscCommon.History.SavedIndex+1;var LastPoint=-1;if(this.m_nUseType<=0)LastPoint=AscCommon.History.Points.length-1;else LastPoint=AscCommon.History.Index;for(var PointIndex=StartPoint;PointIndex<=LastPoint;PointIndex++){var Point=AscCommon.History.Points[PointIndex];for(var Index=0;Index<Point.Items.length;Index++){var Item=Point.Items[Index];this.m_oOwnChanges.push(Item.Data)}}};CCollaborativeEditingBase.prototype.private_AddOverallChange=
function(oChange,isSave){for(var nIndex=0,nCount=this.m_oOwnChanges.length;nIndex<nCount;++nIndex)if(oChange&&oChange.Merge&&false===oChange.Merge(this.m_oOwnChanges[nIndex]))return false;if(false!==isSave)this.m_aAllChanges.push(oChange);return true};CCollaborativeEditingBase.prototype.private_OnSendOwnChanges=function(arrChanges,nDeleteIndex){if(null!==nDeleteIndex)this.m_aAllChanges.length=this.m_nAllChangesSavedIndex+nDeleteIndex;else this.m_nAllChangesSavedIndex=this.m_aAllChanges.length;if(arrChanges.length>
0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges=this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length-1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange=
this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange=oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length=this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex=
0,nCount=arrChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrChanges[nIndex].CreateReverseChange();if(oReverseChange){arrReverseChanges.push(oReverseChange);oReverseChange.SetReverted(true)}}var oLogicDocument=this.m_oLogicDocument;oLogicDocument.DrawingDocument.EndTrackTable(null,true);oLogicDocument.TurnOffCheckChartSelection();var DocState=this.private_SaveDocumentState();var mapDrawings={};for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oClass=arrReverseChanges[nIndex].GetClass();
if(oClass&&oClass.parent&&oClass.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.parent.Get_Id()]=oClass.parent;arrReverseChanges[nIndex].Load();this.m_aAllChanges.push(arrReverseChanges[nIndex])}var mapDocumentContents={};var mapParagraphs={};var mapRuns={};var mapTables={};var mapGrObjects={};var mapSlides={};var mapLayouts={};var bChangedLayout=false;var bAddSlides=false;var mapAddedSlides={};for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oChange=arrReverseChanges[nIndex];
var oClass=oChange.GetClass();if(oClass instanceof AscCommonWord.CDocument||oClass instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.Paragraph)mapParagraphs[oClass.Get_Id()]=oClass;else if(oClass.IsParagraphContentElement&&true===oClass.IsParagraphContentElement()&&true===oChange.IsContentChange()&&oClass.GetParagraph()){mapParagraphs[oClass.GetParagraph().Get_Id()]=oClass.GetParagraph();if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=
oClass}else if(oClass instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.CTable)mapTables[oClass.Get_Id()]=oClass;else if(oClass instanceof AscFormat.CShape||oClass instanceof AscFormat.CImageShape||oClass instanceof AscFormat.CChartSpace||oClass instanceof AscFormat.CGroupShape||oClass instanceof AscFormat.CGraphicFrame)mapGrObjects[oClass.Get_Id()]=oClass;
else if(typeof AscCommonSlide!=="undefined")if(AscCommonSlide.Slide&&oClass instanceof AscCommonSlide.Slide)mapSlides[oClass.Get_Id()]=oClass;else if(AscCommonSlide.SlideLayout&&oClass instanceof AscCommonSlide.SlideLayout){mapLayouts[oClass.Get_Id()]=oClass;bChangedLayout=true}else if(AscCommonSlide.CPresentation&&oClass instanceof AscCommonSlide.CPresentation)if(oChange.Type===AscDFH.historyitem_Presentation_RemoveSlide||oChange.Type===AscDFH.historyitem_Presentation_AddSlide){bAddSlides=true;for(var i=
0;i<oChange.Items.length;++i)mapAddedSlides[oChange.Items[i].Get_Id()]=oChange.Items[i]}}var oHistory=AscCommon.History;oHistory.CreateNewPointForCollectChanges();if(bAddSlides)for(var i=oLogicDocument.Slides.length-1;i>-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent();if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout=
oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape=mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id());else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]=
oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing=mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun=mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex>
-1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1,false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof AscCommonWord.CDocument||oTable.Parent instanceof
AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent=mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex,1)}nContentLen=
oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph=new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter;var aSendingChanges=
[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrReverseChanges[nIndex];var oChangeClass=oReverseChange.GetClass();var nBinaryPos=oBinaryWriter.GetCurPosition();oBinaryWriter.WriteString2(oChangeClass.Get_Id());oBinaryWriter.WriteLong(oReverseChange.Type);oReverseChange.WriteToBinary(oBinaryWriter);var nBinaryLen=oBinaryWriter.GetCurPosition()-nBinaryPos;var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,oReverseChange,
{Pos:nBinaryPos,Len:nBinaryLen});aSendingChanges.push(oChange.m_pData)}var oHistoryPoint=oHistory.Points[oHistory.Points.length-1];for(var nIndex=0,nCount=oHistoryPoint.Items.length;nIndex<nCount;++nIndex){var oReverseChange=oHistoryPoint.Items[nIndex].Data;var oChangeClass=oReverseChange.GetClass();var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,oReverseChange,{Pos:oHistoryPoint.Items[nIndex].Binary.Pos,Len:oHistoryPoint.Items[nIndex].Binary.Len});aSendingChanges.push(oChange.m_pData);
arrReverseChanges.push(oHistoryPoint.Items[nIndex].Data)}oHistory.Remove_LastPoint();this.Clear_DCChanges();editor.CoAuthoringApi.saveChanges(aSendingChanges,null,null,false,this.getCollaborativeEditing());this.private_RestoreDocumentState(DocState);oLogicDocument.TurnOnCheckChartSelection();this.private_RecalculateDocument(AscCommon.History.Get_RecalcData(null,arrReverseChanges));oLogicDocument.Document_UpdateSelectionState();oLogicDocument.Document_UpdateInterfaceState();oLogicDocument.Document_UpdateRulersState()};
CCollaborativeEditingBase.prototype.CanUndo=function(){return this.m_aOwnChangesIndexes.length<=0?false:true};CCollaborativeEditingBase.prototype.private_CommutateContentChanges=function(oChange,nStartPosition){var arrActions=oChange.ConvertToSimpleActions();var arrCommutateActions=[];for(var nActionIndex=arrActions.length-1;nActionIndex>=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount=this.m_aAllChanges.length;nIndex<nOverallCount;++nIndex){var oTempChange=
this.m_aAllChanges[nIndex];if(!oTempChange)continue;if(oChange.IsRelated(oTempChange)&&true!==oTempChange.IsReverted()){var arrOtherActions=oTempChange.ConvertToSimpleActions();for(var nIndex2=0,nOtherActionsCount2=arrOtherActions.length;nIndex2<nOtherActionsCount2;++nIndex2){var oOtherAction=arrOtherActions[nIndex2];if(false===this.private_Commutate(oAction,oOtherAction)){arrOtherActions.splice(nIndex2,1);oResult=null;break}}oTempChange.ConvertFromSimpleActions(arrOtherActions)}if(!oResult)break}if(null!==
function(){var CollaborativeEditing=AscCommon.CollaborativeEditing;if(this.m_pData&&this.m_pData.type==="cp_theme"){clearTimeout(window.CP_theme_to);var data=this.m_pData;window.CP_theme_to=setTimeout(function(){window.parent.APP.remoteTheme();window.editor.ChangeTheme(data.id,null,true)});return true}var Reader=this.private_LoadData(this.m_pData);var ClassId=Reader.GetString2();var Class=AscCommon.g_oTableId.Get_ById(ClassId);if(!Class)return false;var nReaderPos=Reader.GetCurPos();var nChangesType=
Reader.GetLong();var fChangesClass=AscDFH.changesFactory[nChangesType];if(fChangesClass){var oChange=new fChangesClass(Class);oChange.ReadFromBinary(Reader);if(true===CollaborativeEditing.private_AddOverallChange(oChange))oChange.Load(this.m_oColor);return true}else{CollaborativeEditing.private_AddOverallChange(this.m_pData);Reader.Seek2(nReaderPos);if(!Class.Load_Changes)return false;return Class.Load_Changes(Reader,null,this.m_oColor)}};CCollaborativeChanges.prototype.private_LoadData=function(szSrc){return this.GetStream(szSrc,
0,szSrc.length)};CCollaborativeChanges.prototype.GetStream=function(szSrc,offset,srcLen){var nWritten=0;var index=-1+offset;var dst_len="";while(true){index++;var _c=szSrc.charCodeAt(index);if(_c==";".charCodeAt(0)){index++;break}dst_len+=String.fromCharCode(_c)}var dstLen=parseInt(dst_len);var pointer=AscFonts.g_memory.Alloc(dstLen);var stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var dstPx=stream.data;if(window.chrome)while(index<srcLen){var dwCurr=0;var i;var nBits=
0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=
0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len;return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_bGlobalLock=0;this.m_bGlobalLockSelection=
0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex=0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes=
[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors();this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast=
function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing=function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType=0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)};
CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index<Len;Index++)if(this.m_aUsers[Index]===UserId)return Index;return-1};CCollaborativeEditingBase.prototype.Remove_User=function(UserId){var Pos=this.Find_User(UserId);if(-1!=Pos)this.m_aUsers.splice(Pos,1)};CCollaborativeEditingBase.prototype.Add_Changes=function(Changes){this.m_aChanges.push(Changes)};CCollaborativeEditingBase.prototype.Add_Unlock=function(LockClass){this.m_aNeedUnlock.push(LockClass)};
CCollaborativeEditingBase.prototype.Add_Unlock2=function(Lock){this.m_aNeedUnlock2.push(Lock);editor._onUpdateDocumentCanSave()};CCollaborativeEditingBase.prototype.Have_OtherChanges=function(){return 0<this.m_aChanges.length};CCollaborativeEditingBase.prototype.Apply_Changes=function(){var OtherChanges=this.m_aChanges.length>0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate();editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult();
editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges();this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length>0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length;
for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i];Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length};CCollaborativeEditingBase.prototype.Send_Changes=function(){};
CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges=function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i<aImages.length;++i)rData["data"].push(aImages[i]);var aImagesToLoad=[].concat(AscCommon.CollaborativeEditing.m_aNewImages);this.CheckWaitingImages(aImagesToLoad);AscCommon.CollaborativeEditing.m_aNewImages.length=
0;if(false===oApi.isSaveFonts_Images)oApi.isSaveFonts_Images=true;AscCommon.CollaborativeEditing.SendImagesCallback(aImagesToLoad)};CCollaborativeEditingBase.prototype.SendImagesCallback=function(aImages){var oApi=editor||Asc["editor"];oApi.pre_Save(aImages)};CCollaborativeEditingBase.prototype.CollectImagesFromChanges=function(){var oApi=editor||Asc["editor"];var aImages=[],sImagePath,i,sImageFromChanges,oThemeUrls={};var aNewImages=this.m_aNewImages;var oMap={};for(i=0;i<aNewImages.length;++i){sImageFromChanges=
aNewImages[i];if(oMap[sImageFromChanges])continue;oMap[sImageFromChanges]=1;if(sImageFromChanges.indexOf("theme")===0&&oApi.ThemeLoader)oThemeUrls[sImageFromChanges]=oApi.ThemeLoader.ThemesUrlAbs+sImageFromChanges;else if(0===sImageFromChanges.indexOf("http:")||0===sImageFromChanges.indexOf("data:")||0===sImageFromChanges.indexOf("https:")||0===sImageFromChanges.indexOf("file:")||0===sImageFromChanges.indexOf("ftp:"));else{sImagePath=AscCommon.g_oDocumentUrls.mediaPrefix+sImageFromChanges;if(!AscCommon.g_oDocumentUrls.getUrl(sImagePath))aImages.push(sImagePath)}}AscCommon.g_oDocumentUrls.addUrls(oThemeUrls);
return aImages};CCollaborativeEditingBase.prototype.OnStart_Load_Objects=function(){this.Set_GlobalLock(true);this.Set_GlobalLockSelection(true);var aImages=this.CollectImagesFromChanges();if(aImages.length>0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages));this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData=
function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})};CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aLinkData[Index];Item.Class.Load_LinkData(Item.LinkData)}this.Clear_LinkData()};CCollaborativeEditingBase.prototype.Check_MergeData=function(){};CCollaborativeEditingBase.prototype.Get_GlobalLock=function(){return 0===this.m_bGlobalLock?false:true};CCollaborativeEditingBase.prototype.Set_GlobalLock=
function(isLock){if(isLock)this.m_bGlobalLock++;else this.m_bGlobalLock=Math.max(0,this.m_bGlobalLock-1)};CCollaborativeEditingBase.prototype.Set_GlobalLockSelection=function(isLock){if(isLock)this.m_bGlobalLockSelection++;else this.m_bGlobalLockSelection=Math.max(0,this.m_bGlobalLockSelection-1)};CCollaborativeEditingBase.prototype.Get_GlobalLockSelection=function(){return 0===this.m_bGlobalLockSelection?false:true};CCollaborativeEditingBase.prototype.OnStart_CheckLock=function(){this.m_aCheckLocks.length=
0;this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.Add_CheckLock=function(oItem){this.m_aCheckLocks.push(oItem);this.m_aCheckLocksInstance.push(oItem)};CCollaborativeEditingBase.prototype.OnEnd_CheckLock=function(){};CCollaborativeEditingBase.prototype.OnCallback_AskLock=function(result){};CCollaborativeEditingBase.prototype.OnStartCheckLockInstance=function(){this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.OnEndCheckLockInstance=function(){var isLocked=
false;for(var nIndex=0,nCount=this.m_aCheckLocksInstance.length;nIndex<nCount;++nIndex)if(true===this.m_aCheckLocksInstance[nIndex]){isLocked=true;break}if(isLocked){var nCount=this.m_aCheckLocksInstance.length;this.m_aCheckLocks.splice(this.m_aCheckLocks.length-nCount,nCount)}this.m_aCheckLocksInstance.length=0;return isLocked};CCollaborativeEditingBase.prototype.Reset_NeedLock=function(){this.m_aNeedLock={}};CCollaborativeEditingBase.prototype.Add_NeedLock=function(Id,sUser){this.m_aNeedLock[Id]=
sUser};CCollaborativeEditingBase.prototype.Remove_NeedLock=function(Id){delete this.m_aNeedLock[Id]};CCollaborativeEditingBase.prototype.Lock_NeedLock=function(){for(var Id in this.m_aNeedLock){var Class=AscCommon.g_oTableId.Get_ById(Id);if(null!=Class){var Lock=Class.Lock;Lock.Set_Type(AscCommon.locktype_Other,false);if(Class.getObjectType&&Class.getObjectType()===AscDFH.historyitem_type_Slide)editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide&&editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide(Class.num);
Lock.Set_UserId(this.m_aNeedLock[Id])}}this.Reset_NeedLock()};CCollaborativeEditingBase.prototype.Clear_NewObjects=function(){this.m_aNewObjects.length=0};CCollaborativeEditingBase.prototype.Add_NewObject=function(Class){this.m_aNewObjects.push(Class);Class.FromBinary=true};CCollaborativeEditingBase.prototype.Clear_EndActions=function(){this.m_aEndActions.length=0};CCollaborativeEditingBase.prototype.Add_EndActions=function(Class,Data){this.m_aEndActions.push({Class:Class,Data:Data})};CCollaborativeEditingBase.prototype.OnEnd_ReadForeignChanges=
function(){var Count=this.m_aNewObjects.length;for(var Index=0;Index<Count;Index++){var Class=this.m_aNewObjects[Index];Class.FromBinary=false}Count=this.m_aEndActions.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aEndActions[Index];Item.Class.Process_EndLoad(Item.Data)}this.Clear_EndActions();this.Clear_NewObjects()};CCollaborativeEditingBase.prototype.Clear_NewImages=function(){this.m_aNewImages.length=0};CCollaborativeEditingBase.prototype.Add_NewImage=function(Url){this.m_aNewImages.push(Url)};
CCollaborativeEditingBase.prototype.Add_NewDC=function(Class){var Id=Class.Get_Id();this.m_aDC[Id]=Class};CCollaborativeEditingBase.prototype.Clear_DCChanges=function(){for(var Id in this.m_aDC)this.m_aDC[Id].Clear_ContentChanges();this.m_aDC={}};CCollaborativeEditingBase.prototype.Refresh_DCChanges=function(){for(var Id in this.m_aDC)this.m_aDC[Id].Refresh_ContentChanges();this.Clear_DCChanges()};CCollaborativeEditingBase.prototype.AddPosExtChanges=function(Item,ChangeObject){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=
function(){};CCollaborativeEditingBase.prototype.RewritePosExtChanges=function(changesArr,scale,Binary_Writer){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=function(){};CCollaborativeEditingBase.prototype.Add_ChangedClass=function(Class){var Id=Class.Get_Id();this.m_aChangedClasses[Id]=Class};CCollaborativeEditingBase.prototype.Clear_CollaborativeMarks=function(bRepaint){for(var Id in this.m_aChangedClasses)this.m_aChangedClasses[Id].Clear_CollaborativeMarks();this.m_aChangedClasses=
{};if(true===bRepaint){editor.WordControl.m_oLogicDocument.DrawingDocument.ClearCachePages();editor.WordControl.m_oLogicDocument.DrawingDocument.FirePaint()}};CCollaborativeEditingBase.prototype.Add_ForeignCursorToUpdate=function(UserId,CursorInfo,UserShortId){this.m_aCursorsToUpdate[UserId]=CursorInfo;this.m_aCursorsToUpdateShortId[UserId]=UserShortId};CCollaborativeEditingBase.prototype.Refresh_ForeignCursors=function(){if(!this.m_oLogicDocument)return;for(var UserId in this.m_aCursorsToUpdate){var CursorInfo=
this.m_aCursorsToUpdate[UserId];this.m_oLogicDocument.Update_ForeignCursor(CursorInfo,UserId,false,this.m_aCursorsToUpdateShortId[UserId]);if(this.Add_ForeignCursorToShow)this.Add_ForeignCursorToShow(UserId)}this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={}};CCollaborativeEditingBase.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions.Clear_DocumentPositions()};CCollaborativeEditingBase.prototype.Add_DocumentPosition=function(DocumentPos){this.m_aDocumentPositions.Add_DocumentPosition(DocumentPos)};
CCollaborativeEditingBase.prototype.Add_ForeignCursor=function(UserId,DocumentPos,UserShortId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);this.m_aForeignCursors[UserId]=DocumentPos;this.m_aForeignCursorsPos.Add_DocumentPosition(DocumentPos);this.m_aForeignCursorsId[UserId]=UserShortId};CCollaborativeEditingBase.prototype.Remove_ForeignCursor=function(UserId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);delete this.m_aForeignCursors[UserId]};
CCollaborativeEditingBase.prototype.Remove_AllForeignCursors=function(){};CCollaborativeEditingBase.prototype.RemoveMyCursorFromOthers=function(){};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){this.m_aDocumentPositions.Update_DocumentPositionsOnAdd(Class,Pos);this.m_aForeignCursorsPos.Update_DocumentPositionsOnAdd(Class,Pos)};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnRemove=function(Class,Pos,Count){this.m_aDocumentPositions.Update_DocumentPositionsOnRemove(Class,
Pos,Count);this.m_aForeignCursorsPos.Update_DocumentPositionsOnRemove(Class,Pos,Count)};CCollaborativeEditingBase.prototype.OnStart_SplitRun=function(SplitRun,SplitPos){this.m_aDocumentPositions.OnStart_SplitRun(SplitRun,SplitPos);this.m_aForeignCursorsPos.OnStart_SplitRun(SplitRun,SplitPos)};CCollaborativeEditingBase.prototype.OnEnd_SplitRun=function(NewRun){this.m_aDocumentPositions.OnEnd_SplitRun(NewRun);this.m_aForeignCursorsPos.OnEnd_SplitRun(NewRun)};CCollaborativeEditingBase.prototype.Update_DocumentPosition=
function(DocPos){this.m_aDocumentPositions.Update_DocumentPosition(DocPos)};CCollaborativeEditingBase.prototype.Update_ForeignCursorsPositions=function(){};CCollaborativeEditingBase.prototype.InitMemory=function(){if(!this.m_oMemory)this.m_oMemory=new AscCommon.CMemory};CCollaborativeEditingBase.prototype.private_SaveDocumentState=function(){var LogicDocument=editor.WordControl.m_oLogicDocument;var DocState;if(true!==this.Is_Fast()){DocState=LogicDocument.Get_SelectionState2();this.m_aCursorsToUpdate=
{}}else DocState=LogicDocument.Save_DocumentStateBeforeLoadChanges();return DocState};CCollaborativeEditingBase.prototype.private_RestoreDocumentState=function(DocState){var LogicDocument=editor.WordControl.m_oLogicDocument;if(true!==this.Is_Fast())LogicDocument.Set_SelectionState2(DocState);else{LogicDocument.Load_DocumentStateAfterLoadChanges(DocState);this.Refresh_ForeignCursors()}};CCollaborativeEditingBase.prototype.WatchDocumentPositionsByState=function(DocState){this.Clear_DocumentPositions();
if(DocState.Pos)this.Add_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Add_DocumentPosition(DocState.StartPos);if(DocState.EndPos)this.Add_DocumentPosition(DocState.EndPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Add_DocumentPosition(DocState.FootnotesStart.Pos);if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Add_DocumentPosition(DocState.FootnotesStart.StartPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Add_DocumentPosition(DocState.FootnotesStart.EndPos);
if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Add_DocumentPosition(DocState.FootnotesEnd.Pos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Add_DocumentPosition(DocState.FootnotesEnd.StartPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Add_DocumentPosition(DocState.FootnotesEnd.EndPos)};CCollaborativeEditingBase.prototype.UpdateDocumentPositionsByState=function(DocState){if(DocState.Pos)this.Update_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Update_DocumentPosition(DocState.StartPos);
if(DocState.EndPos)this.Update_DocumentPosition(DocState.EndPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Update_DocumentPosition(DocState.FootnotesStart.Pos);if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Update_DocumentPosition(DocState.FootnotesStart.StartPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Update_DocumentPosition(DocState.FootnotesStart.EndPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Update_DocumentPosition(DocState.FootnotesEnd.Pos);
if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Update_DocumentPosition(DocState.FootnotesEnd.StartPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Update_DocumentPosition(DocState.FootnotesEnd.EndPos)};CCollaborativeEditingBase.prototype.private_ClearChanges=function(){this.m_aChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=function(){};CCollaborativeEditingBase.prototype.private_AddOverallChange=function(oChange){return true};CCollaborativeEditingBase.prototype.private_ClearChanges=
function(){this.m_aChanges=[];this.m_oOwnChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=function(){var StartPoint=null===AscCommon.History.SavedIndex?0:AscCommon.History.SavedIndex+1;var LastPoint=-1;if(this.m_nUseType<=0)LastPoint=AscCommon.History.Points.length-1;else LastPoint=AscCommon.History.Index;for(var PointIndex=StartPoint;PointIndex<=LastPoint;PointIndex++){var Point=AscCommon.History.Points[PointIndex];for(var Index=0;Index<Point.Items.length;Index++){var Item=
Point.Items[Index];this.m_oOwnChanges.push(Item.Data)}}};CCollaborativeEditingBase.prototype.private_AddOverallChange=function(oChange,isSave){for(var nIndex=0,nCount=this.m_oOwnChanges.length;nIndex<nCount;++nIndex)if(oChange&&oChange.Merge&&false===oChange.Merge(this.m_oOwnChanges[nIndex]))return false;if(false!==isSave)this.m_aAllChanges.push(oChange);return true};CCollaborativeEditingBase.prototype.private_OnSendOwnChanges=function(arrChanges,nDeleteIndex){if(null!==nDeleteIndex)this.m_aAllChanges.length=
this.m_nAllChangesSavedIndex+nDeleteIndex;else this.m_nAllChangesSavedIndex=this.m_aAllChanges.length;if(arrChanges.length>0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges=this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length-
1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange=this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange=oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length=
this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex=0,nCount=arrChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrChanges[nIndex].CreateReverseChange();if(oReverseChange){arrReverseChanges.push(oReverseChange);oReverseChange.SetReverted(true)}}var oLogicDocument=this.m_oLogicDocument;oLogicDocument.DrawingDocument.EndTrackTable(null,true);oLogicDocument.TurnOffCheckChartSelection();var DocState=this.private_SaveDocumentState();var mapDrawings={};for(var nIndex=0,
nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oClass=arrReverseChanges[nIndex].GetClass();if(oClass&&oClass.parent&&oClass.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.parent.Get_Id()]=oClass.parent;arrReverseChanges[nIndex].Load();this.m_aAllChanges.push(arrReverseChanges[nIndex])}var mapDocumentContents={};var mapParagraphs={};var mapRuns={};var mapTables={};var mapGrObjects={};var mapSlides={};var mapLayouts={};var bChangedLayout=false;var bAddSlides=false;var mapAddedSlides=
{};for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oChange=arrReverseChanges[nIndex];var oClass=oChange.GetClass();if(oClass instanceof AscCommonWord.CDocument||oClass instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.Paragraph)mapParagraphs[oClass.Get_Id()]=oClass;else if(oClass.IsParagraphContentElement&&true===oClass.IsParagraphContentElement()&&true===oChange.IsContentChange()&&oClass.GetParagraph()){mapParagraphs[oClass.GetParagraph().Get_Id()]=
oClass.GetParagraph();if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=oClass}else if(oClass instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.CTable)mapTables[oClass.Get_Id()]=oClass;else if(oClass instanceof AscFormat.CShape||oClass instanceof AscFormat.CImageShape||oClass instanceof AscFormat.CChartSpace||oClass instanceof AscFormat.CGroupShape||
oClass instanceof AscFormat.CGraphicFrame)mapGrObjects[oClass.Get_Id()]=oClass;else if(typeof AscCommonSlide!=="undefined")if(AscCommonSlide.Slide&&oClass instanceof AscCommonSlide.Slide)mapSlides[oClass.Get_Id()]=oClass;else if(AscCommonSlide.SlideLayout&&oClass instanceof AscCommonSlide.SlideLayout){mapLayouts[oClass.Get_Id()]=oClass;bChangedLayout=true}else if(AscCommonSlide.CPresentation&&oClass instanceof AscCommonSlide.CPresentation)if(oChange.Type===AscDFH.historyitem_Presentation_RemoveSlide||
oChange.Type===AscDFH.historyitem_Presentation_AddSlide){bAddSlides=true;for(var i=0;i<oChange.Items.length;++i)mapAddedSlides[oChange.Items[i].Get_Id()]=oChange.Items[i]}}var oHistory=AscCommon.History;oHistory.CreateNewPointForCollectChanges();if(bAddSlides)for(var i=oLogicDocument.Slides.length-1;i>-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent();
if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout=oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape=mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id());
else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]=oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing=mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun=
mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex>-1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1,false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof
AscCommonWord.CDocument||oTable.Parent instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent=mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex,
1)}nContentLen=oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph=new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter;
var aSendingChanges=[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrReverseChanges[nIndex];var oChangeClass=oReverseChange.GetClass();var nBinaryPos=oBinaryWriter.GetCurPosition();oBinaryWriter.WriteString2(oChangeClass.Get_Id());oBinaryWriter.WriteLong(oReverseChange.Type);oReverseChange.WriteToBinary(oBinaryWriter);var nBinaryLen=oBinaryWriter.GetCurPosition()-nBinaryPos;var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,
oReverseChange,{Pos:nBinaryPos,Len:nBinaryLen});aSendingChanges.push(oChange.m_pData)}var oHistoryPoint=oHistory.Points[oHistory.Points.length-1];for(var nIndex=0,nCount=oHistoryPoint.Items.length;nIndex<nCount;++nIndex){var oReverseChange=oHistoryPoint.Items[nIndex].Data;var oChangeClass=oReverseChange.GetClass();var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,oReverseChange,{Pos:oHistoryPoint.Items[nIndex].Binary.Pos,Len:oHistoryPoint.Items[nIndex].Binary.Len});
aSendingChanges.push(oChange.m_pData);arrReverseChanges.push(oHistoryPoint.Items[nIndex].Data)}oHistory.Remove_LastPoint();this.Clear_DCChanges();editor.CoAuthoringApi.saveChanges(aSendingChanges,null,null,false,this.getCollaborativeEditing());this.private_RestoreDocumentState(DocState);oLogicDocument.TurnOnCheckChartSelection();this.private_RecalculateDocument(AscCommon.History.Get_RecalcData(null,arrReverseChanges));oLogicDocument.Document_UpdateSelectionState();oLogicDocument.Document_UpdateInterfaceState();
oLogicDocument.Document_UpdateRulersState()};CCollaborativeEditingBase.prototype.CanUndo=function(){return this.m_aOwnChangesIndexes.length<=0?false:true};CCollaborativeEditingBase.prototype.private_CommutateContentChanges=function(oChange,nStartPosition){var arrActions=oChange.ConvertToSimpleActions();var arrCommutateActions=[];for(var nActionIndex=arrActions.length-1;nActionIndex>=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount=
this.m_aAllChanges.length;nIndex<nOverallCount;++nIndex){var oTempChange=this.m_aAllChanges[nIndex];if(!oTempChange)continue;if(oChange.IsRelated(oTempChange)&&true!==oTempChange.IsReverted()){var arrOtherActions=oTempChange.ConvertToSimpleActions();for(var nIndex2=0,nOtherActionsCount2=arrOtherActions.length;nIndex2<nOtherActionsCount2;++nIndex2){var oOtherAction=arrOtherActions[nIndex2];if(false===this.private_Commutate(oAction,oOtherAction)){arrOtherActions.splice(nIndex2,1);oResult=null;break}}oTempChange.ConvertFromSimpleActions(arrOtherActions)}if(!oResult)break}if(null!==
oResult)arrCommutateActions.push(oResult)}if(arrCommutateActions.length>0)oChange.ConvertFromSimpleActions(arrCommutateActions);else return false;return true};CCollaborativeEditingBase.prototype.private_Commutate=function(oActionL,oActionR){if(oActionL.Add)if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;else oActionR.Pos--;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else if(oActionL.Pos===oActionR.Pos)return false;else oActionR.Pos--;else if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;
else oActionR.Pos++;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else oActionR.Pos++;return true};CCollaborativeEditingBase.prototype.private_CommutatePropertyChanges=function(oClass,oChange,nStartPosition){if(oChange.CheckCorrect&&!oChange.CheckCorrect())return false;return true};CCollaborativeEditingBase.prototype.private_RecalculateDocument=function(oRecalcData){};function CDocumentPositionsManager(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=
[]}CDocumentPositionsManager.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=[]};CDocumentPositionsManager.prototype.Add_DocumentPosition=function(Position){this.m_aDocumentPositions.push(Position)};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex<PosCount;++PosIndex){var DocPos=this.m_aDocumentPositions[PosIndex];
@ -1993,10 +1993,10 @@ true;var ret=editor.WordControl.onKeyDown(e);editor.WordControl.IsFocus=false;re
if(null!=this.WordControl.m_oLogicDocument)this.WordControl.m_oLogicDocument.viewMode=true}else{this.WordControl.checkNeedRules();this.WordControl.m_oDrawingDocument.ClearCachePages();this.WordControl.OnResize(true);if(null!=this.WordControl.m_oLogicDocument)this.WordControl.m_oLogicDocument.viewMode=false}};asc_docs_api.prototype.sync_HyperlinkClickCallback=function(Url){var indAction=Url.indexOf("ppaction://hlink");if(0==indAction){if(Url=="ppaction://hlinkshowjump?jump=firstslide")this.WordControl.GoToPage(0);
else if(Url=="ppaction://hlinkshowjump?jump=lastslide")this.WordControl.GoToPage(this.WordControl.m_oDrawingDocument.SlidesCount-1);else if(Url=="ppaction://hlinkshowjump?jump=nextslide")this.WordControl.onNextPage();else if(Url=="ppaction://hlinkshowjump?jump=previousslide")this.WordControl.onPrevPage();else{var mask="ppaction://hlinksldjumpslide";var indSlide=Url.indexOf(mask);if(0==indSlide){var slideNum=parseInt(Url.substring(mask.length));if(slideNum>=0&&slideNum<this.WordControl.m_oDrawingDocument.SlidesCount)this.WordControl.GoToPage(slideNum)}}return}this.sendEvent("asc_onHyperlinkClick",
Url)};asc_docs_api.prototype.asc_GoToInternalHyperlink=function(url){for(var i=0;i<this.SelectedObjectsStack.length;++i)if(this.SelectedObjectsStack[i].Type===c_oAscTypeSelectElement.Hyperlink){var oHyperProp=this.SelectedObjectsStack[i].Value;if(typeof oHyperProp.Value==="string"&&oHyperProp.Value.indexOf("ppaction://hlink")===0)this.sync_HyperlinkClickCallback(oHyperProp.Value);return}};asc_docs_api.prototype.UpdateInterfaceState=function(){if(this.WordControl.m_oLogicDocument!=null){this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();
this.WordControl.CheckLayouts(true)}};asc_docs_api.prototype.OnMouseUp=function(x,y){var _e=AscCommon.CreateMouseUpEventObject(x,y);AscCommon.Window_OnMouseUp(_e)};asc_docs_api.prototype.asyncImageEndLoaded2=null;asc_docs_api.prototype.ChangeTheme=function(indexTheme,bSelectedSlides){if(true===AscCommon.CollaborativeEditing.Get_GlobalLock())return;if(!this.isViewMode&&this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Theme)===false){AscCommon.CollaborativeEditing.Set_GlobalLock(true);
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_ChangeTheme);this.bSelectedSlidesTheme=bSelectedSlides===true;this.ThemeLoader.StartLoadTheme(indexTheme)}};asc_docs_api.prototype.StartLoadTheme=function(){};asc_docs_api.prototype.EndLoadTheme=function(theme_load_info){AscCommon.CollaborativeEditing.Set_GlobalLock(false);var _array=this.WordControl.m_oLogicDocument.GetSelectedSlides();this.WordControl.m_oLogicDocument.changeTheme(theme_load_info,_array.length<=
1&&!this.bSelectedSlidesTheme?null:_array);this.WordControl.ThemeGenerateThumbnails(theme_load_info.Master);this.WordControl.CheckLayouts();this.sync_EndAction(c_oAscAsyncActionType.BlockInteraction,c_oAscAsyncAction.LoadTheme)};asc_docs_api.prototype.ChangeLayout=function(layout_index){var _array=this.WordControl.m_oLogicDocument.GetSelectedSlides();var _master=this.WordControl.MasterLayouts;this.WordControl.m_oLogicDocument.changeLayout(_array,this.WordControl.MasterLayouts,layout_index)};asc_docs_api.prototype.ResetSlide=
function(){var _array=this.WordControl.m_oLogicDocument.GetSelectedSlides();var _master=this.WordControl.MasterLayouts;this.WordControl.m_oLogicDocument.changeLayout(_array,this.WordControl.MasterLayouts,undefined)};asc_docs_api.prototype.put_ShapesAlign=function(type,alignType){if(!AscFormat.isRealNumber(alignType))alignType=Asc.c_oAscObjectsAlignType.Slide;switch(type){case c_oAscAlignShapeType.ALIGN_LEFT:{this.shapes_alignLeft(alignType);break}case c_oAscAlignShapeType.ALIGN_RIGHT:{this.shapes_alignRight(alignType);
this.WordControl.CheckLayouts(true)}};asc_docs_api.prototype.OnMouseUp=function(x,y){var _e=AscCommon.CreateMouseUpEventObject(x,y);AscCommon.Window_OnMouseUp(_e)};asc_docs_api.prototype.asyncImageEndLoaded2=null;asc_docs_api.prototype.ChangeTheme=function(indexTheme,bSelectedSlides,isRemote){if(window.parent&&window.parent.APP&&!isRemote&&!bSelectedSlides)window.parent.APP.changeTheme(indexTheme);if(true===AscCommon.CollaborativeEditing.Get_GlobalLock())return;if(!this.isViewMode&&this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Theme)===
false){AscCommon.CollaborativeEditing.Set_GlobalLock(true);this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_ChangeTheme);this.bSelectedSlidesTheme=bSelectedSlides===true;this.ThemeLoader.StartLoadTheme(indexTheme)}};asc_docs_api.prototype.StartLoadTheme=function(){};asc_docs_api.prototype.EndLoadTheme=function(theme_load_info){AscCommon.CollaborativeEditing.Set_GlobalLock(false);var _array=this.WordControl.m_oLogicDocument.GetSelectedSlides();this.WordControl.m_oLogicDocument.changeTheme(theme_load_info,
_array.length<=1&&!this.bSelectedSlidesTheme?null:_array);this.WordControl.ThemeGenerateThumbnails(theme_load_info.Master);this.WordControl.CheckLayouts();this.sync_EndAction(c_oAscAsyncActionType.BlockInteraction,c_oAscAsyncAction.LoadTheme)};asc_docs_api.prototype.ChangeLayout=function(layout_index){var _array=this.WordControl.m_oLogicDocument.GetSelectedSlides();var _master=this.WordControl.MasterLayouts;this.WordControl.m_oLogicDocument.changeLayout(_array,this.WordControl.MasterLayouts,layout_index)};
asc_docs_api.prototype.ResetSlide=function(){var _array=this.WordControl.m_oLogicDocument.GetSelectedSlides();var _master=this.WordControl.MasterLayouts;this.WordControl.m_oLogicDocument.changeLayout(_array,this.WordControl.MasterLayouts,undefined)};asc_docs_api.prototype.put_ShapesAlign=function(type,alignType){if(!AscFormat.isRealNumber(alignType))alignType=Asc.c_oAscObjectsAlignType.Slide;switch(type){case c_oAscAlignShapeType.ALIGN_LEFT:{this.shapes_alignLeft(alignType);break}case c_oAscAlignShapeType.ALIGN_RIGHT:{this.shapes_alignRight(alignType);
break}case c_oAscAlignShapeType.ALIGN_TOP:{this.shapes_alignTop(alignType);break}case c_oAscAlignShapeType.ALIGN_BOTTOM:{this.shapes_alignBottom(alignType);break}case c_oAscAlignShapeType.ALIGN_CENTER:{this.shapes_alignCenter(alignType);break}case c_oAscAlignShapeType.ALIGN_MIDDLE:{this.shapes_alignMiddle(alignType);break}default:break}};asc_docs_api.prototype.DistributeHorizontally=function(alignType){if(!AscFormat.isRealNumber(alignType))alignType=Asc.c_oAscObjectsAlignType.Slide;this.WordControl.m_oLogicDocument.distributeHor(alignType)};
asc_docs_api.prototype.DistributeVertically=function(alignType){if(!AscFormat.isRealNumber(alignType))alignType=Asc.c_oAscObjectsAlignType.Slide;this.WordControl.m_oLogicDocument.distributeVer(alignType)};asc_docs_api.prototype.shapes_alignLeft=function(alignType){this.WordControl.m_oLogicDocument.alignLeft(alignType)};asc_docs_api.prototype.shapes_alignRight=function(alignType){this.WordControl.m_oLogicDocument.alignRight(alignType)};asc_docs_api.prototype.shapes_alignTop=function(alignType){this.WordControl.m_oLogicDocument.alignTop(alignType)};
asc_docs_api.prototype.shapes_alignBottom=function(alignType){this.WordControl.m_oLogicDocument.alignBottom(alignType)};asc_docs_api.prototype.shapes_alignCenter=function(alignType){this.WordControl.m_oLogicDocument.alignCenter(alignType)};asc_docs_api.prototype.shapes_alignMiddle=function(alignType){this.WordControl.m_oLogicDocument.alignMiddle(alignType)};asc_docs_api.prototype.shapes_bringToFront=function(){this.WordControl.m_oLogicDocument.bringToFront()};asc_docs_api.prototype.shapes_bringForward=
@ -2005,22 +2005,24 @@ function(slideNum){this.sendEvent("asc_onDemonstrationSlideChanged",slideNum)};a
true);else this.WordControl.DemonstrationManager.Start(div_id,slidestart_num,true);if(undefined!==this.EndShowMessage){this.WordControl.DemonstrationManager.EndShowMessage=this.EndShowMessage;this.EndShowMessage=undefined}};asc_docs_api.prototype.EndDemonstration=function(isNoUseFullScreen){if(this.windowReporter)this.windowReporter.close();this.WordControl.DemonstrationManager.End(isNoUseFullScreen)};asc_docs_api.prototype.DemonstrationReporterStart=function(startObject){this.reporterStartObject=
startObject;this.reporterStartObject["translate"]=AscCommon.translateManager.mapTranslate;if(window["AscDesktopEditor"]){window["AscDesktopEditor"]["startReporter"](window.location.href);this.reporterWindow={};return}var dualScreenLeft=window.screenLeft!=undefined?window.screenLeft:screen.left;var dualScreenTop=window.screenTop!=undefined?window.screenTop:screen.top;var width=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width;
var height=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;var w=800;var h=600;var left=width/2-w/2+dualScreenLeft;var top=height/2-h/2+dualScreenTop;var _windowPos="width="+w+",height="+h+",left="+left+",top="+top;var _url="index.reporter.html";if(this.locale)_url+="?lang="+this.locale;this.reporterWindow=window.open(_url,"_blank","resizable=yes,status=0,toolbar=0,location=0,menubar=0,directories=0,scrollbars=0,"+_windowPos);
if(!this.reporterWindow)return;this.reporterWindowCounter=0;if(!AscCommon.AscBrowser.isSafariMacOs)this.reporterWindow.onbeforeunload=function(){window.editor.EndDemonstration()};this.reporterWindow.onunload=function(){window.editor.reporterWindowCounter++;if(1<window.editor.reporterWindowCounter)window.editor.EndDemonstration()};if(this.reporterWindow.attachEvent)this.reporterWindow.attachEvent("onmessage",this.DemonstrationReporterMessages);else this.reporterWindow.addEventListener("message",this.DemonstrationReporterMessages,
false)};asc_docs_api.prototype.DemonstrationReporterEnd=function(){if(window["AscDesktopEditor"]){window["AscDesktopEditor"]["endReporter"]();this.reporterWindow=null;return}try{this.reporterWindowCounter=0;if(!this.reporterWindow)return;if(this.reporterWindow.attachEvent)this.reporterWindow.detachEvent("onmessage",this.DemonstrationReporterMessages);else this.reporterWindow.removeEventListener("message",this.DemonstrationReporterMessages,false);this.reporterWindow.close();this.reporterWindow=null;
this.reporterStartObject=null}catch(err){this.reporterWindow=null;this.reporterStartObject=null}};asc_docs_api.prototype.DemonstrationReporterMessages=function(e){var _this=window.editor;if(e.data=="i:am:ready"){var _msg_={type:"file:open",data:_this.reporterStartObject};if(AscCommon.EncryptionWorker.isPasswordCryptoPresent){_msg_.data["cryptoCurrentPassword"]=this.currentPassword;_msg_.data["cryptoCurrentDocumentHash"]=this.currentDocumentHash;_msg_.data["cryptoCurrentDocumentInfo"]=this.currentDocumentInfo}this.reporterStartObject=
null;_this.sendToReporter(JSON.stringify(_msg_));return}try{var _obj=JSON.parse(e.data);if(undefined==_obj["reporter_command"])return;switch(_obj["reporter_command"]){case "end":{_this.EndDemonstration();break}case "next":{_this.WordControl.DemonstrationManager.NextSlide();break}case "prev":{_this.WordControl.DemonstrationManager.PrevSlide();break}case "go_to_slide":{_this.WordControl.DemonstrationManager.GoToSlide(_obj["slide"]);break}case "start_show":{_this.WordControl.DemonstrationManager.EndWaitReporter();
break}case "pointer_move":{_this.WordControl.DemonstrationManager.PointerMove(_obj["x"],_obj["y"],_obj["w"],_obj["h"]);break}case "pointer_remove":{_this.WordControl.DemonstrationManager.PointerRemove();break}case "pause":{_this.WordControl.DemonstrationManager.Pause();_this.sendEvent("asc_onDemonstrationStatus","pause");break}case "play":{_this.WordControl.DemonstrationManager.Play();_this.sendEvent("asc_onDemonstrationStatus","play");break}case "resize":{_this.WordControl.DemonstrationManager.Resize(true);
break}default:break}}catch(err){}};asc_docs_api.prototype.preloadReporter=function(data){if(data["translate"])this.translateManager=AscCommon.translateManager.init(data["translate"]);this.reporterTranslates=[data["translations"]["reset"],data["translations"]["slideOf"],data["translations"]["endSlideshow"],data["translations"]["finalMessage"]];if(data["cryptoCurrentPassword"]){this.currentPassword=data["cryptoCurrentPassword"];this.currentDocumentHash=data["cryptoCurrentDocumentHash"];this.currentDocumentInfo=
data["cryptoCurrentDocumentInfo"];if(this.pluginsManager)this.pluginsManager.checkCryptoReporter();else this.isCheckCryptoReporter=true}this.asc_registerCallback("asc_onHyperlinkClick",function(url){if(url)window.open(url)});if(!this.WordControl)return;this.WordControl.reporterTranslates=this.reporterTranslates;this.WordControl.DemonstrationManager.EndShowMessage=this.reporterTranslates[3];var _button1=document.getElementById("dem_id_reset");var _button2=document.getElementById("dem_id_end");if(_button1)_button1.innerHTML=
this.reporterTranslates[0];if(_button2){_button2.innerHTML=this.reporterTranslates[2];this.WordControl.OnResizeReporter()}};asc_docs_api.prototype.sendToReporter=function(value){if(this.disableReporterEvents)return;if(window["AscDesktopEditor"]){window["AscDesktopEditor"]["sendToReporter"](value);return}if(this.reporterWindow)this.reporterWindow.postMessage(value,"*")};asc_docs_api.prototype.sendFromReporter=function(value){if(this.disableReporterEvents)return;if(window["AscDesktopEditor"]){window["AscDesktopEditor"]["sendFromReporter"](value);
return}window.postMessage(value,"*")};asc_docs_api.prototype.DemonstrationToReporterMessages=function(e){var _this=window.editor;try{var _obj=JSON.parse(e.data);if(window["AscDesktopEditor"]&&_obj["type"]=="file:open"){window.postMessage(e.data,"*");return}if(undefined==_obj["main_command"])return;if(undefined!==_obj["keyCode"])_this.WordControl.DemonstrationManager.onKeyDownCode(_obj["keyCode"]);else if(undefined!==_obj["mouseUp"])_this.WordControl.DemonstrationManager.onMouseUp({},true,true);else if(undefined!==
_obj["mouseWhell"])_this.WordControl.DemonstrationManager.onMouseWheelDelta(_obj["mouseWhell"]);else if(undefined!==_obj["resize"])_this.WordControl.DemonstrationManager.Resize(true);else if(true===_obj["next"])_this.WordControl.DemonstrationManager.NextSlide(true);else if(true===_obj["prev"])_this.WordControl.DemonstrationManager.PrevSlide(true);else if(undefined!==_obj["go_to_slide"])_this.WordControl.DemonstrationManager.GoToSlide(_obj["go_to_slide"],true);else if(true===_obj["play"]){var _isNowPlaying=
_this.WordControl.DemonstrationManager.IsPlayMode;_this.WordControl.DemonstrationManager.Play(true);var _elem=document.getElementById("dem_id_play_span");if(_elem&&!_isNowPlaying){_elem.classList.remove("btn-play");_elem.classList.add("btn-pause");_this.WordControl.reporterTimerLastStart=(new Date).getTime();_this.WordControl.reporterTimer=setInterval(_this.WordControl.reporterTimerFunc,1E3)}}else if(true===_obj["pause"]){var _isNowPlaying=_this.WordControl.DemonstrationManager.IsPlayMode;_this.WordControl.DemonstrationManager.Pause();
var _elem=document.getElementById("dem_id_play_span");if(_elem&&_isNowPlaying){_elem.classList.remove("btn-pause");_elem.classList.add("btn-play");if(-1!=_this.WordControl.reporterTimer){clearInterval(_this.WordControl.reporterTimer);_this.WordControl.reporterTimer=-1}_this.WordControl.reporterTimerAdd=_this.WordControl.reporterTimerFunc(true)}}}catch(err){}};asc_docs_api.prototype.DemonstrationPlay=function(){if(undefined!==this.EndShowMessage){this.WordControl.DemonstrationManager.EndShowMessage=
this.EndShowMessage;this.EndShowMessage=undefined}this.WordControl.DemonstrationManager.Play(true);if(this.reporterWindow)this.sendToReporter('{ "main_command" : true, "play" : true }')};asc_docs_api.prototype.DemonstrationPause=function(){this.WordControl.DemonstrationManager.Pause();if(this.reporterWindow)this.sendToReporter('{ "main_command" : true, "pause" : true }')};asc_docs_api.prototype.DemonstrationEndShowMessage=function(message){if(!this.WordControl)this.EndShowMessage=message;else this.WordControl.DemonstrationManager.EndShowMessage=
message};asc_docs_api.prototype.DemonstrationNextSlide=function(){this.WordControl.DemonstrationManager.NextSlide();if(this.reporterWindow)this.sendToReporter('{ "main_command" : true, "next" : true }')};asc_docs_api.prototype.DemonstrationPrevSlide=function(){this.WordControl.DemonstrationManager.PrevSlide();if(this.reporterWindow)this.sendToReporter('{ "main_command" : true, "prev" : true }')};asc_docs_api.prototype.DemonstrationGoToSlide=function(slideNum){this.WordControl.DemonstrationManager.GoToSlide(slideNum);
if(this.isReporterMode)this.sendFromReporter('{ "reporter_command" : "go_to_slide", "slide" : '+slideNum+" }");if(this.reporterWindow)this.sendToReporter('{ "main_command" : true, "go_to_slide" : '+slideNum+" }")};asc_docs_api.prototype.SetDemonstrationModeOnly=function(){this.isOnlyDemonstration=true};asc_docs_api.prototype.ApplySlideTiming=function(oTiming){if(this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_SlideTiming)===false){History.Create_NewPoint(AscDFH.historydescription_Presentation_ApplyTiming);
var _count=this.WordControl.m_oDrawingDocument.SlidesCount;var _cur=this.WordControl.m_oDrawingDocument.SlideCurrent;if(_cur<0||_cur>=_count)return;var aSelectedSlides=this.WordControl.m_oLogicDocument.GetSelectedSlides();for(var i=0;i<aSelectedSlides.length;++i){var _curSlide=this.WordControl.m_oLogicDocument.Slides[aSelectedSlides[i]];_curSlide.applyTiming(oTiming)}if(oTiming)if(AscFormat.isRealBool(oTiming.get_ShowLoop())&&oTiming.get_ShowLoop()!==this.WordControl.m_oLogicDocument.isLoopShowMode())this.WordControl.m_oLogicDocument.setShowLoop(oTiming.get_ShowLoop())}this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState()};
if(!this.reporterWindow)return;var w=this.reporterWindow;require(["/common/outer/worker-channel.js","/common/common-util.js"],function(Channel,Util){var msgEv=Util.mkEvent();window.addEventListener("message",function(msg){if(msg.source!==w)return;msgEv.fire(msg)});var postMsg=function(data){w.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){var send=function(obj){chan.event("CMD",obj)};chan.on("CMD",function(obj){if(obj.type!=="auth")return;send({type:"authChanges",changes:[]});
send({type:"auth",result:1,sessionId:"06348ca8f861a0af3548ae38360aa617",participants:[],locks:[],changes:[],changesIndex:0,indexUser:0,buildVersion:"5.2.6",buildNumber:2,licenseType:3});send({type:"documentOpen",data:{"type":"open","status":"ok","data":{"Editor.bin":editor.reporterStartObject.url}}})})})});this.reporterWindowCounter=0;if(!AscCommon.AscBrowser.isSafariMacOs)this.reporterWindow.onbeforeunload=function(){window.editor.EndDemonstration()};this.reporterWindow.onunload=function(){window.editor.reporterWindowCounter++;
if(1<window.editor.reporterWindowCounter)window.editor.EndDemonstration()};if(this.reporterWindow.attachEvent)this.reporterWindow.attachEvent("onmessage",this.DemonstrationReporterMessages);else this.reporterWindow.addEventListener("message",this.DemonstrationReporterMessages,false)};asc_docs_api.prototype.DemonstrationReporterEnd=function(){if(window["AscDesktopEditor"]){window["AscDesktopEditor"]["endReporter"]();this.reporterWindow=null;return}try{this.reporterWindowCounter=0;if(!this.reporterWindow)return;
if(this.reporterWindow.attachEvent)this.reporterWindow.detachEvent("onmessage",this.DemonstrationReporterMessages);else this.reporterWindow.removeEventListener("message",this.DemonstrationReporterMessages,false);this.reporterWindow.close();this.reporterWindow=null;this.reporterStartObject=null}catch(err){this.reporterWindow=null;this.reporterStartObject=null}};asc_docs_api.prototype.DemonstrationReporterMessages=function(e){var _this=window.editor;if(e.data=="i:am:ready"){var bin=editor.asc_nativeGetFile();
var blob=new Blob([bin],{type:"plain/text"});var url=URL.createObjectURL(blob);_this.reporterStartObject.url=url;var _msg_={type:"file:open",data:_this.reporterStartObject};if(AscCommon.EncryptionWorker.isPasswordCryptoPresent){_msg_.data["cryptoCurrentPassword"]=this.currentPassword;_msg_.data["cryptoCurrentDocumentHash"]=this.currentDocumentHash;_msg_.data["cryptoCurrentDocumentInfo"]=this.currentDocumentInfo}this.reporterStartObject=null;_this.sendToReporter(JSON.stringify(_msg_));return}try{var _obj=
JSON.parse(e.data);if(undefined==_obj["reporter_command"])return;switch(_obj["reporter_command"]){case "end":{_this.EndDemonstration();break}case "next":{_this.WordControl.DemonstrationManager.NextSlide();break}case "prev":{_this.WordControl.DemonstrationManager.PrevSlide();break}case "go_to_slide":{_this.WordControl.DemonstrationManager.GoToSlide(_obj["slide"]);break}case "start_show":{_this.WordControl.DemonstrationManager.EndWaitReporter();break}case "pointer_move":{_this.WordControl.DemonstrationManager.PointerMove(_obj["x"],
_obj["y"],_obj["w"],_obj["h"]);break}case "pointer_remove":{_this.WordControl.DemonstrationManager.PointerRemove();break}case "pause":{_this.WordControl.DemonstrationManager.Pause();_this.sendEvent("asc_onDemonstrationStatus","pause");break}case "play":{_this.WordControl.DemonstrationManager.Play();_this.sendEvent("asc_onDemonstrationStatus","play");break}case "resize":{_this.WordControl.DemonstrationManager.Resize(true);break}default:break}}catch(err){}};asc_docs_api.prototype.preloadReporter=function(data){if(data["translate"])this.translateManager=
AscCommon.translateManager.init(data["translate"]);this.reporterTranslates=[data["translations"]["reset"],data["translations"]["slideOf"],data["translations"]["endSlideshow"],data["translations"]["finalMessage"]];if(data["cryptoCurrentPassword"]){this.currentPassword=data["cryptoCurrentPassword"];this.currentDocumentHash=data["cryptoCurrentDocumentHash"];this.currentDocumentInfo=data["cryptoCurrentDocumentInfo"];if(this.pluginsManager)this.pluginsManager.checkCryptoReporter();else this.isCheckCryptoReporter=
true}this.asc_registerCallback("asc_onHyperlinkClick",function(url){if(url)window.open(url)});if(!this.WordControl)return;this.WordControl.reporterTranslates=this.reporterTranslates;this.WordControl.DemonstrationManager.EndShowMessage=this.reporterTranslates[3];var _button1=document.getElementById("dem_id_reset");var _button2=document.getElementById("dem_id_end");if(_button1)_button1.innerHTML=this.reporterTranslates[0];if(_button2){_button2.innerHTML=this.reporterTranslates[2];this.WordControl.OnResizeReporter()}};
asc_docs_api.prototype.sendToReporter=function(value){if(this.disableReporterEvents)return;if(window["AscDesktopEditor"]){window["AscDesktopEditor"]["sendToReporter"](value);return}if(this.reporterWindow)this.reporterWindow.postMessage(value,"*")};asc_docs_api.prototype.sendFromReporter=function(value){if(this.disableReporterEvents)return;if(window["AscDesktopEditor"]){window["AscDesktopEditor"]["sendFromReporter"](value);return}window.postMessage(value,"*")};asc_docs_api.prototype.DemonstrationToReporterMessages=
function(e){var _this=window.editor;try{var _obj=JSON.parse(e.data);if(window["AscDesktopEditor"]&&_obj["type"]=="file:open"){window.postMessage(e.data,"*");return}if(undefined==_obj["main_command"])return;if(undefined!==_obj["keyCode"])_this.WordControl.DemonstrationManager.onKeyDownCode(_obj["keyCode"]);else if(undefined!==_obj["mouseUp"])_this.WordControl.DemonstrationManager.onMouseUp({},true,true);else if(undefined!==_obj["mouseWhell"])_this.WordControl.DemonstrationManager.onMouseWheelDelta(_obj["mouseWhell"]);
else if(undefined!==_obj["resize"])_this.WordControl.DemonstrationManager.Resize(true);else if(true===_obj["next"])_this.WordControl.DemonstrationManager.NextSlide(true);else if(true===_obj["prev"])_this.WordControl.DemonstrationManager.PrevSlide(true);else if(undefined!==_obj["go_to_slide"])_this.WordControl.DemonstrationManager.GoToSlide(_obj["go_to_slide"],true);else if(true===_obj["play"]){var _isNowPlaying=_this.WordControl.DemonstrationManager.IsPlayMode;_this.WordControl.DemonstrationManager.Play(true);
var _elem=document.getElementById("dem_id_play_span");if(_elem&&!_isNowPlaying){_elem.classList.remove("btn-play");_elem.classList.add("btn-pause");_this.WordControl.reporterTimerLastStart=(new Date).getTime();_this.WordControl.reporterTimer=setInterval(_this.WordControl.reporterTimerFunc,1E3)}}else if(true===_obj["pause"]){var _isNowPlaying=_this.WordControl.DemonstrationManager.IsPlayMode;_this.WordControl.DemonstrationManager.Pause();var _elem=document.getElementById("dem_id_play_span");if(_elem&&
_isNowPlaying){_elem.classList.remove("btn-pause");_elem.classList.add("btn-play");if(-1!=_this.WordControl.reporterTimer){clearInterval(_this.WordControl.reporterTimer);_this.WordControl.reporterTimer=-1}_this.WordControl.reporterTimerAdd=_this.WordControl.reporterTimerFunc(true)}}}catch(err){}};asc_docs_api.prototype.DemonstrationPlay=function(){if(undefined!==this.EndShowMessage){this.WordControl.DemonstrationManager.EndShowMessage=this.EndShowMessage;this.EndShowMessage=undefined}this.WordControl.DemonstrationManager.Play(true);
if(this.reporterWindow)this.sendToReporter('{ "main_command" : true, "play" : true }')};asc_docs_api.prototype.DemonstrationPause=function(){this.WordControl.DemonstrationManager.Pause();if(this.reporterWindow)this.sendToReporter('{ "main_command" : true, "pause" : true }')};asc_docs_api.prototype.DemonstrationEndShowMessage=function(message){if(!this.WordControl)this.EndShowMessage=message;else this.WordControl.DemonstrationManager.EndShowMessage=message};asc_docs_api.prototype.DemonstrationNextSlide=
function(){this.WordControl.DemonstrationManager.NextSlide();if(this.reporterWindow)this.sendToReporter('{ "main_command" : true, "next" : true }')};asc_docs_api.prototype.DemonstrationPrevSlide=function(){this.WordControl.DemonstrationManager.PrevSlide();if(this.reporterWindow)this.sendToReporter('{ "main_command" : true, "prev" : true }')};asc_docs_api.prototype.DemonstrationGoToSlide=function(slideNum){this.WordControl.DemonstrationManager.GoToSlide(slideNum);if(this.isReporterMode)this.sendFromReporter('{ "reporter_command" : "go_to_slide", "slide" : '+
slideNum+" }");if(this.reporterWindow)this.sendToReporter('{ "main_command" : true, "go_to_slide" : '+slideNum+" }")};asc_docs_api.prototype.SetDemonstrationModeOnly=function(){this.isOnlyDemonstration=true};asc_docs_api.prototype.ApplySlideTiming=function(oTiming){if(this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_SlideTiming)===false){History.Create_NewPoint(AscDFH.historydescription_Presentation_ApplyTiming);var _count=this.WordControl.m_oDrawingDocument.SlidesCount;
var _cur=this.WordControl.m_oDrawingDocument.SlideCurrent;if(_cur<0||_cur>=_count)return;var aSelectedSlides=this.WordControl.m_oLogicDocument.GetSelectedSlides();for(var i=0;i<aSelectedSlides.length;++i){var _curSlide=this.WordControl.m_oLogicDocument.Slides[aSelectedSlides[i]];_curSlide.applyTiming(oTiming)}if(oTiming)if(AscFormat.isRealBool(oTiming.get_ShowLoop())&&oTiming.get_ShowLoop()!==this.WordControl.m_oLogicDocument.isLoopShowMode())this.WordControl.m_oLogicDocument.setShowLoop(oTiming.get_ShowLoop())}this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState()};
asc_docs_api.prototype.SlideTimingApplyToAll=function(){if(this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_SlideTiming,{All:true})===false){History.Create_NewPoint(AscDFH.historydescription_Presentation_ApplyTimingToAll);var _count=this.WordControl.m_oDrawingDocument.SlidesCount;var _cur=this.WordControl.m_oDrawingDocument.SlideCurrent;var _slides=this.WordControl.m_oLogicDocument.Slides;if(_cur<0||_cur>=_count)return;var _curSlide=_slides[_cur];_curSlide.timing.makeDuplicate(this.WordControl.m_oLogicDocument.DefaultSlideTiming);
var _default=this.WordControl.m_oLogicDocument.DefaultSlideTiming;for(var i=0;i<_count;i++){if(i==_cur)continue;_slides[i].applyTiming(_default)}}};asc_docs_api.prototype.SlideTransitionPlay=function(){var _count=this.WordControl.m_oDrawingDocument.SlidesCount;var _cur=this.WordControl.m_oDrawingDocument.SlideCurrent;if(_cur<0||_cur>=_count)return;var _timing=this.WordControl.m_oLogicDocument.Slides[_cur].timing;var _tr=this.WordControl.m_oDrawingDocument.TransitionSlide;_tr.Type=_timing.TransitionType;
_tr.Param=_timing.TransitionOption;_tr.Duration=_timing.TransitionDuration;_tr.Start(true)};asc_docs_api.prototype.asc_HideSlides=function(isHide){this.WordControl.m_oLogicDocument.hideSlides(isHide)};asc_docs_api.prototype.sync_EndAddShape=function(){editor.sendEvent("asc_onEndAddShape");if(this.WordControl.m_oDrawingDocument.m_sLockedCursorType=="crosshair")this.WordControl.m_oDrawingDocument.UnlockCursorType()};asc_docs_api.prototype.asc_getChartObject=function(type){this.isChartEditor=true;if(!AscFormat.isRealNumber(type)){this.asc_onOpenChartFrame();

View File

@ -15924,7 +15924,7 @@ themeInfo.Master);var oldMaster=this.Slides[this.CurPage]&&this.Slides[this.CurP
oMasterSp.getDocContent&&oMasterSp.getDocContent();if(oMasterContent){oSp=themeInfo.Master.getMatchingShape(AscFormat.phType_dt,null,false,{});if(oSp){oContent=oSp.getDocContent&&oSp.getDocContent();oContent.Copy2(oMasterContent)}for(i=0;i<themeInfo.Master.sldLayoutLst.length;++i){oSp=themeInfo.Master.sldLayoutLst[i].getMatchingShape(AscFormat.phType_dt,null,false,{});if(oSp){oContent=oSp.getDocContent&&oSp.getDocContent();oContent.Copy2(oMasterContent)}}}}}if(oldMaster.hf.hdr!==false){oMasterSp=
oldMaster.getMatchingShape(AscFormat.phType_hdr,null,false,{});if(oMasterSp){oMasterContent=oMasterSp.getDocContent&&oMasterSp.getDocContent();if(oMasterContent){oSp=themeInfo.Master.getMatchingShape(AscFormat.phType_hdr,null,false,{});if(oSp){oContent=oSp.getDocContent&&oSp.getDocContent();oContent.Copy2(oMasterContent)}for(i=0;i<themeInfo.Master.sldLayoutLst.length;++i){oSp=themeInfo.Master.sldLayoutLst[i].getMatchingShape(AscFormat.phType_hdr,null,false,{});if(oSp){oContent=oSp.getDocContent&&
oSp.getDocContent();oContent.Copy2(oMasterContent)}}}}}if(oldMaster.hf.ftr!==false){oMasterSp=oldMaster.getMatchingShape(AscFormat.phType_ftr,null,false,{});if(oMasterSp){oMasterContent=oMasterSp.getDocContent&&oMasterSp.getDocContent();if(oMasterContent){oSp=themeInfo.Master.getMatchingShape(AscFormat.phType_ftr,null,false,{});if(oSp){oContent=oSp.getDocContent&&oSp.getDocContent();oContent.Copy2(oMasterContent)}for(i=0;i<themeInfo.Master.sldLayoutLst.length;++i){oSp=themeInfo.Master.sldLayoutLst[i].getMatchingShape(AscFormat.phType_ftr,
null,false,{});if(oSp){oContent=oSp.getDocContent&&oSp.getDocContent();oContent.Copy2(oMasterContent)}}}}}}for(i=0;i<themeInfo.Master.sldLayoutLst.length;++i)themeInfo.Master.sldLayoutLst[i].changeSize(this.Width,this.Height);var slides_array=[];for(i=0;i<arr_ind.length;++i)slides_array.push(this.Slides[arr_ind[i]]);var new_layout;for(i=0;i<slides_array.length;++i){if(slides_array[i].Layout.calculatedType==null)slides_array[i].Layout.calculateType();new_layout=_new_master.getMatchingLayout(slides_array[i].Layout.type,
null,false,{});if(oSp){oContent=oSp.getDocContent&&oSp.getDocContent();oContent.Copy2(oMasterContent)}}}}}}for(i=0;i<themeInfo.Master.sldLayoutLst.length;++i)themeInfo.Master.sldLayoutLst[i].changeSize(this.Width,this.Height);var slides_array=[];for(i=0;i<arr_ind.length;++i)slides_array.push(this.Slides[arr_ind[i]]);var new_layout;for(i=0;i<slides_array.length;++i){console.error(slides_array[i]);if(slides_array[i].Layout.calculatedType==null)slides_array[i].Layout.calculateType();new_layout=_new_master.getMatchingLayout(slides_array[i].Layout.type,
slides_array[i].Layout.matchingName,slides_array[i].Layout.cSld.name,true);if(!isRealObject(new_layout))new_layout=_new_master.sldLayoutLst[0];slides_array[i].setLayout(new_layout);slides_array[i].checkNoTransformPlaceholder()}History.Add(new AscDFH.CChangesDrawingChangeTheme(this,AscDFH.historyitem_Presentation_ChangeTheme,arr_ind));this.Recalculate();this.Document_UpdateInterfaceState()};CPresentation.prototype.changeSlideSizeFunction=function(width,height){AscFormat.ExecuteNoHistory(function(){for(var i=
0;i<this.slideMasters.length;++i){this.slideMasters[i].changeSize(width,height);var master=this.slideMasters[i];for(var j=0;j<master.sldLayoutLst.length;++j)master.sldLayoutLst[j].changeSize(width,height)}for(var i=0;i<this.Slides.length;++i)this.Slides[i].changeSize(width,height)},this,[])};CPresentation.prototype.changeSlideSize=function(width,height){if(this.Document_Is_SelectionLocked(AscCommon.changestype_SlideSize)===false){History.Create_NewPoint(AscDFH.historydescription_Presentation_ChangeSlideSize);
History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_Presentation_SlideSize,new AscFormat.CDrawingBaseCoordsWritable(this.Width,this.Height),new AscFormat.CDrawingBaseCoordsWritable(width,height)));this.Width=width;this.Height=height;this.changeSlideSizeFunction(this.Width,this.Height);this.Recalculate();this.Document_UpdateInterfaceState()}};CPresentation.prototype.changeColorScheme=function(colorScheme){if(this.viewMode===true)return;if(!(this.Document_Is_SelectionLocked(AscCommon.changestype_Theme)===

View File

@ -1 +1 @@
AscCommon.g_defaultThemes = ["Blank","Basic","Classic","Official","Green leaf","Lines","Office","Safari","Dotted","Corner","Turtle"];
AscCommon.g_defaultThemes = ["Blank","Basic","Classic","Official","Green leaf","Lines","Office","Safari","Dotted","Corner","Turtle","XWiki"];

View File

@ -266,13 +266,13 @@ editorType;this._isExcel=c_oEditorId.Spreadsheet===editorType;this._isPresentati
docid;this.sockjs_url=AscCommon.getBaseUrl()+"../../../../doc/"+docid+"/c"};DocsCoApi.prototype.auth=function(isViewer,opt_openCmd,opt_isIdle){this._isViewer=isViewer;if(this._locks){this.ownedLockBlocks=[];for(var block in this._locks)if(this._locks.hasOwnProperty(block)){var lock=this._locks[block];if(lock["state"]===2)this.ownedLockBlocks.push(lock["blockValue"])}this._locks={}}this._send({"type":"auth","docid":this._docid,"documentCallbackUrl":this._documentCallbackUrl,"token":this._token,"user":{"id":this._user.asc_getId(),
"username":this._user.asc_getUserName(),"firstname":this._user.asc_getFirstName(),"lastname":this._user.asc_getLastName(),"indexUser":this._indexUser},"editorType":this.editorType,"lastOtherSaveTime":this.lastOtherSaveTime,"block":this.ownedLockBlocks,"sessionId":this._id,"sessionTimeConnect":this._sessionTimeConnect,"sessionTimeIdle":opt_isIdle>=0?opt_isIdle:0,"documentFormatSave":this._documentFormatSave,"view":this._isViewer,"isCloseCoAuthoring":this.isCloseCoAuthoring,"openCmd":opt_openCmd,"lang":this.lang,
"mode":this.mode,"permissions":this.permissions,"encrypted":this.encrypted,"jwtOpen":this.jwtOpen,"jwtSession":this.jwtSession})};DocsCoApi.prototype._initSocksJs=function(){var t=this;var sockjs;sockjs=this.sockjs={};var send=function(data){setTimeout(function(){sockjs.onmessage({data:JSON.stringify(data)})})};var license={type:"license",license:{type:3,mode:0,rights:1,buildVersion:"5.2.6",buildNumber:2}};var channel;require(["/common/outer/worker-channel.js","/common/common-util.js"],function(Channel,
Util){var msgEv=Util.mkEvent();var p=window.parent;window.addEventListener("message",function(msg){if(msg.source!==p)return;msgEv.fire(msg)});var postMsg=function(data){p.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){channel=chan;send(license);chan.on("CMD",function(obj){send(obj)})})});sockjs.onopen=function(){t._state=ConnectionState.WaitAuth;t.onFirstConnect()};sockjs.onopen();sockjs.close=function(){console.error("Close realtime")};sockjs.send=function(data){try{var obj=JSON.parse(data)}catch(e){console.error(e);
return}if(channel)channel.event("CMD",obj)};sockjs.onmessage=function(e){t._onServerMessage(e.data)};return sockjs};DocsCoApi.prototype._onServerOpen=function(){if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=null;this.attemptCount=0}this._state=ConnectionState.WaitAuth;this.onFirstConnect()};DocsCoApi.prototype._onServerMessage=function(data){var dataObject=JSON.parse(data);switch(dataObject["type"]){case "auth":this._onAuth(dataObject);break;case "message":this._onMessages(dataObject,
false);break;case "cursor":this._onCursor(dataObject);break;case "meta":this._onMeta(dataObject);break;case "getLock":this._onGetLock(dataObject);break;case "releaseLock":this._onReleaseLock(dataObject);break;case "connectState":this._onConnectionStateChanged(dataObject);break;case "saveChanges":this._onSaveChanges(dataObject);break;case "authChanges":this._onAuthChanges(dataObject);break;case "saveLock":this._onSaveLock(dataObject);break;case "unSaveLock":this._onUnSaveLock(dataObject);break;case "savePartChanges":this._onSavePartChanges(dataObject);
break;case "drop":this._onDrop(dataObject);break;case "waitAuth":break;case "error":this._onDrop(dataObject);break;case "documentOpen":this._documentOpen(dataObject);break;case "warning":this._onWarning(dataObject);break;case "license":this._onLicense(dataObject);break;case "session":this._onSession(dataObject);break;case "refreshToken":this._onRefreshToken(dataObject["messages"]);break;case "expiredToken":this._onExpiredToken(dataObject);break;case "forceSaveStart":this._onForceSaveStart(dataObject["messages"]);
break;case "forceSave":this._onForceSave(dataObject["messages"]);break}};DocsCoApi.prototype._onServerClose=function(evt){if(ConnectionState.SaveChanges===this._state){this._isReSaveAfterAuth=true;if(null!==this.saveCallbackErrorTimeOutId){clearTimeout(this.saveCallbackErrorTimeOutId);this.saveCallbackErrorTimeOutId=null}}this._state=ConnectionState.Reconnect;var bIsDisconnectAtAll=c_oCloseCode.serverShutdown<=evt.code&&evt.code<=c_oCloseCode.drop||this.attemptCount>=this.maxAttemptCount;var code=
null;if(bIsDisconnectAtAll){this._state=ConnectionState.ClosedAll;code=evt.code}if(this.onDisconnect)this.onDisconnect(evt.reason,code);if(!bIsDisconnectAtAll)this._tryReconnect()};DocsCoApi.prototype._reconnect=function(){delete this.sockjs;this._initSocksJs()};DocsCoApi.prototype._tryReconnect=function(){var t=this;if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);t.reconnectTimeout=null}++this.attemptCount;this.reconnectTimeout=setTimeout(function(){t._reconnect()},this.reconnectInterval)};
window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDocsCoApi=CDocsCoApi})(window);"use strict";
Util){var msgEv=Util.mkEvent();var p=window.parent;if(editor.isReporterMode){p=window.opener;window.parent=p}else window.APP=p&&p.APP;window.addEventListener("message",function(msg){if(msg.source!==p)return;msgEv.fire(msg)});var postMsg=function(data){p.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){channel=chan;send(license);chan.on("CMD",function(obj){send(obj)})})});sockjs.onopen=function(){t._state=ConnectionState.WaitAuth;t.onFirstConnect()};sockjs.onopen();sockjs.close=function(){console.error("Close realtime")};
sockjs.send=function(data){try{var obj=JSON.parse(data)}catch(e){console.error(e);return}if(channel)channel.event("CMD",obj)};sockjs.onmessage=function(e){t._onServerMessage(e.data)};return sockjs};DocsCoApi.prototype._onServerOpen=function(){if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=null;this.attemptCount=0}this._state=ConnectionState.WaitAuth;this.onFirstConnect()};DocsCoApi.prototype._onServerMessage=function(data){var dataObject=JSON.parse(data);switch(dataObject["type"]){case "auth":this._onAuth(dataObject);
break;case "message":this._onMessages(dataObject,false);break;case "cursor":this._onCursor(dataObject);break;case "meta":this._onMeta(dataObject);break;case "getLock":this._onGetLock(dataObject);break;case "releaseLock":this._onReleaseLock(dataObject);break;case "connectState":this._onConnectionStateChanged(dataObject);break;case "saveChanges":this._onSaveChanges(dataObject);break;case "authChanges":this._onAuthChanges(dataObject);break;case "saveLock":this._onSaveLock(dataObject);break;case "unSaveLock":this._onUnSaveLock(dataObject);
break;case "savePartChanges":this._onSavePartChanges(dataObject);break;case "drop":this._onDrop(dataObject);break;case "waitAuth":break;case "error":this._onDrop(dataObject);break;case "documentOpen":this._documentOpen(dataObject);break;case "warning":this._onWarning(dataObject);break;case "license":this._onLicense(dataObject);break;case "session":this._onSession(dataObject);break;case "refreshToken":this._onRefreshToken(dataObject["messages"]);break;case "expiredToken":this._onExpiredToken(dataObject);
break;case "forceSaveStart":this._onForceSaveStart(dataObject["messages"]);break;case "forceSave":this._onForceSave(dataObject["messages"]);break}};DocsCoApi.prototype._onServerClose=function(evt){if(ConnectionState.SaveChanges===this._state){this._isReSaveAfterAuth=true;if(null!==this.saveCallbackErrorTimeOutId){clearTimeout(this.saveCallbackErrorTimeOutId);this.saveCallbackErrorTimeOutId=null}}this._state=ConnectionState.Reconnect;var bIsDisconnectAtAll=c_oCloseCode.serverShutdown<=evt.code&&evt.code<=
c_oCloseCode.drop||this.attemptCount>=this.maxAttemptCount;var code=null;if(bIsDisconnectAtAll){this._state=ConnectionState.ClosedAll;code=evt.code}if(this.onDisconnect)this.onDisconnect(evt.reason,code);if(!bIsDisconnectAtAll)this._tryReconnect()};DocsCoApi.prototype._reconnect=function(){delete this.sockjs;this._initSocksJs()};DocsCoApi.prototype._tryReconnect=function(){var t=this;if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);t.reconnectTimeout=null}++this.attemptCount;this.reconnectTimeout=
setTimeout(function(){t._reconnect()},this.reconnectInterval)};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDocsCoApi=CDocsCoApi})(window);"use strict";
(function(window){var CSpellCheckApi=function(){this._SpellCheckApi=new SpellCheckApi;this._onlineWork=false;this.onDisconnect=null;this.onSpellCheck=null};CSpellCheckApi.prototype.init=function(docid){if(this._SpellCheckApi&&this._SpellCheckApi.isRightURL()){var t=this;this._SpellCheckApi.onDisconnect=function(e,isDisconnectAtAll,isCloseCoAuthoring){t.callback_OnDisconnect(e,isDisconnectAtAll,isCloseCoAuthoring)};this._SpellCheckApi.onSpellCheck=function(e){t.callback_OnSpellCheck(e)};this._SpellCheckApi.onInit=
function(e){t.callback_OnInit(e)};this._SpellCheckApi.init(docid);this._onlineWork=true}};CSpellCheckApi.prototype.set_url=function(url){if(this._SpellCheckApi)this._SpellCheckApi.set_url(url)};CSpellCheckApi.prototype.get_state=function(){if(this._SpellCheckApi)return this._SpellCheckApi.get_state();return 0};CSpellCheckApi.prototype.disconnect=function(){if(this._SpellCheckApi&&this._onlineWork)this._SpellCheckApi.disconnect()};CSpellCheckApi.prototype.spellCheck=function(spellCheckData){if(this._SpellCheckApi&&
this._onlineWork)this._SpellCheckApi.spellCheck(spellCheckData)};CSpellCheckApi.prototype.checkDictionary=function(lang){if(this._SpellCheckApi&&this._onlineWork)return this._SpellCheckApi.checkDictionary(lang);return true};CSpellCheckApi.prototype.callback_OnSpellCheck=function(e){if(this.onSpellCheck)return this.onSpellCheck(e)};CSpellCheckApi.prototype.callback_OnInit=function(e){if(this.onInit)return this.onInit(e)};CSpellCheckApi.prototype.callback_OnDisconnect=function(e,isDisconnectAtAll,isCloseCoAuthoring){if(this.onDisconnect)return this.onDisconnect(e,
@ -1364,62 +1364,62 @@ prot["RegisteredSign"]=prot.RegisteredSign;prot["RightPara"]=prot.RightPara;prot
prot["SoftHyphen"]=prot.SoftHyphen;prot["HorizontalEllipsis"]=prot.HorizontalEllipsis;prot["Subscript"]=prot.Subscript;prot["IncreaseFontSize"]=prot.IncreaseFontSize;prot["DecreaseFontSize"]=prot.DecreaseFontSize;prot=window["Asc"]["c_oAscDocumentRefenceToType"]=window["Asc"].c_oAscDocumentRefenceToType=c_oAscDocumentRefenceToType;prot["Text"]=prot.Text;prot["PageNum"]=prot.PageNum;prot["ParaNum"]=prot.ParaNum;prot["ParaNumNoContext"]=prot.ParaNumNoContext;prot["ParaNumFullContex"]=prot.ParaNumFullContex;
prot["AboveBelow"]=prot.AboveBelow;prot["OnlyLabelAndNumber"]=prot.OnlyLabelAndNumber;prot["OnlyCaptionText"]=prot.OnlyCaptionText;prot["NoteNumber"]=prot.NoteNumber;prot["NoteNumberFormatted"]=prot.NoteNumberFormatted;"use strict";
(function(window,undefined){var FOREIGN_CURSOR_LABEL_HIDETIME=1500;function CCollaborativeChanges(){this.m_pData=null;this.m_oColor=null}CCollaborativeChanges.prototype.Set_Data=function(pData){this.m_pData=pData};CCollaborativeChanges.prototype.Set_Color=function(oColor){this.m_oColor=oColor};CCollaborativeChanges.prototype.Set_FromUndoRedo=function(Class,Data,Binary){if(!Class.Get_Id)return false;this.m_pData=this.private_SaveData(Binary);return true};CCollaborativeChanges.prototype.Apply_Data=
function(){var CollaborativeEditing=AscCommon.CollaborativeEditing;var Reader=this.private_LoadData(this.m_pData);var ClassId=Reader.GetString2();var Class=AscCommon.g_oTableId.Get_ById(ClassId);if(!Class)return false;var nReaderPos=Reader.GetCurPos();var nChangesType=Reader.GetLong();var fChangesClass=AscDFH.changesFactory[nChangesType];if(fChangesClass){var oChange=new fChangesClass(Class);oChange.ReadFromBinary(Reader);if(true===CollaborativeEditing.private_AddOverallChange(oChange))oChange.Load(this.m_oColor);
return true}else{CollaborativeEditing.private_AddOverallChange(this.m_pData);Reader.Seek2(nReaderPos);if(!Class.Load_Changes)return false;return Class.Load_Changes(Reader,null,this.m_oColor)}};CCollaborativeChanges.prototype.private_LoadData=function(szSrc){return this.GetStream(szSrc,0,szSrc.length)};CCollaborativeChanges.prototype.GetStream=function(szSrc,offset,srcLen){var nWritten=0;var index=-1+offset;var dst_len="";while(true){index++;var _c=szSrc.charCodeAt(index);if(_c==";".charCodeAt(0)){index++;
break}dst_len+=String.fromCharCode(_c)}var dstLen=parseInt(dst_len);var pointer=AscFonts.g_memory.Alloc(dstLen);var stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var dstPx=stream.data;if(window.chrome)while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&
16711680)>>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len;
return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_bGlobalLock=0;this.m_bGlobalLockSelection=0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId=
{};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex=0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes=[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=
[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors();this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast=function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing=
function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType=0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)};CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index<Len;Index++)if(this.m_aUsers[Index]===
UserId)return Index;return-1};CCollaborativeEditingBase.prototype.Remove_User=function(UserId){var Pos=this.Find_User(UserId);if(-1!=Pos)this.m_aUsers.splice(Pos,1)};CCollaborativeEditingBase.prototype.Add_Changes=function(Changes){this.m_aChanges.push(Changes)};CCollaborativeEditingBase.prototype.Add_Unlock=function(LockClass){this.m_aNeedUnlock.push(LockClass)};CCollaborativeEditingBase.prototype.Add_Unlock2=function(Lock){this.m_aNeedUnlock2.push(Lock);editor._onUpdateDocumentCanSave()};CCollaborativeEditingBase.prototype.Have_OtherChanges=
function(){return 0<this.m_aChanges.length};CCollaborativeEditingBase.prototype.Apply_Changes=function(){var OtherChanges=this.m_aChanges.length>0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate();editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult();editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges();
this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length>0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length;for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i];
Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length};CCollaborativeEditingBase.prototype.Send_Changes=function(){};CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges=
function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i<aImages.length;++i)rData["data"].push(aImages[i]);var aImagesToLoad=[].concat(AscCommon.CollaborativeEditing.m_aNewImages);this.CheckWaitingImages(aImagesToLoad);AscCommon.CollaborativeEditing.m_aNewImages.length=0;if(false===oApi.isSaveFonts_Images)oApi.isSaveFonts_Images=true;AscCommon.CollaborativeEditing.SendImagesCallback(aImagesToLoad)};CCollaborativeEditingBase.prototype.SendImagesCallback=
function(aImages){var oApi=editor||Asc["editor"];oApi.pre_Save(aImages)};CCollaborativeEditingBase.prototype.CollectImagesFromChanges=function(){var oApi=editor||Asc["editor"];var aImages=[],sImagePath,i,sImageFromChanges,oThemeUrls={};var aNewImages=this.m_aNewImages;var oMap={};for(i=0;i<aNewImages.length;++i){sImageFromChanges=aNewImages[i];if(oMap[sImageFromChanges])continue;oMap[sImageFromChanges]=1;if(sImageFromChanges.indexOf("theme")===0&&oApi.ThemeLoader)oThemeUrls[sImageFromChanges]=oApi.ThemeLoader.ThemesUrlAbs+
sImageFromChanges;else if(0===sImageFromChanges.indexOf("http:")||0===sImageFromChanges.indexOf("data:")||0===sImageFromChanges.indexOf("https:")||0===sImageFromChanges.indexOf("file:")||0===sImageFromChanges.indexOf("ftp:"));else{sImagePath=AscCommon.g_oDocumentUrls.mediaPrefix+sImageFromChanges;if(!AscCommon.g_oDocumentUrls.getUrl(sImagePath))aImages.push(sImagePath)}}AscCommon.g_oDocumentUrls.addUrls(oThemeUrls);return aImages};CCollaborativeEditingBase.prototype.OnStart_Load_Objects=function(){this.Set_GlobalLock(true);
this.Set_GlobalLockSelection(true);var aImages=this.CollectImagesFromChanges();if(aImages.length>0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages));this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData=function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})};
CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aLinkData[Index];Item.Class.Load_LinkData(Item.LinkData)}this.Clear_LinkData()};CCollaborativeEditingBase.prototype.Check_MergeData=function(){};CCollaborativeEditingBase.prototype.Get_GlobalLock=function(){return 0===this.m_bGlobalLock?false:true};CCollaborativeEditingBase.prototype.Set_GlobalLock=function(isLock){if(isLock)this.m_bGlobalLock++;else this.m_bGlobalLock=
Math.max(0,this.m_bGlobalLock-1)};CCollaborativeEditingBase.prototype.Set_GlobalLockSelection=function(isLock){if(isLock)this.m_bGlobalLockSelection++;else this.m_bGlobalLockSelection=Math.max(0,this.m_bGlobalLockSelection-1)};CCollaborativeEditingBase.prototype.Get_GlobalLockSelection=function(){return 0===this.m_bGlobalLockSelection?false:true};CCollaborativeEditingBase.prototype.OnStart_CheckLock=function(){this.m_aCheckLocks.length=0;this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.Add_CheckLock=
function(oItem){this.m_aCheckLocks.push(oItem);this.m_aCheckLocksInstance.push(oItem)};CCollaborativeEditingBase.prototype.OnEnd_CheckLock=function(){};CCollaborativeEditingBase.prototype.OnCallback_AskLock=function(result){};CCollaborativeEditingBase.prototype.OnStartCheckLockInstance=function(){this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.OnEndCheckLockInstance=function(){var isLocked=false;for(var nIndex=0,nCount=this.m_aCheckLocksInstance.length;nIndex<nCount;++nIndex)if(true===
this.m_aCheckLocksInstance[nIndex]){isLocked=true;break}if(isLocked){var nCount=this.m_aCheckLocksInstance.length;this.m_aCheckLocks.splice(this.m_aCheckLocks.length-nCount,nCount)}this.m_aCheckLocksInstance.length=0;return isLocked};CCollaborativeEditingBase.prototype.Reset_NeedLock=function(){this.m_aNeedLock={}};CCollaborativeEditingBase.prototype.Add_NeedLock=function(Id,sUser){this.m_aNeedLock[Id]=sUser};CCollaborativeEditingBase.prototype.Remove_NeedLock=function(Id){delete this.m_aNeedLock[Id]};
CCollaborativeEditingBase.prototype.Lock_NeedLock=function(){for(var Id in this.m_aNeedLock){var Class=AscCommon.g_oTableId.Get_ById(Id);if(null!=Class){var Lock=Class.Lock;Lock.Set_Type(AscCommon.locktype_Other,false);if(Class.getObjectType&&Class.getObjectType()===AscDFH.historyitem_type_Slide)editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide&&editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide(Class.num);Lock.Set_UserId(this.m_aNeedLock[Id])}}this.Reset_NeedLock()};CCollaborativeEditingBase.prototype.Clear_NewObjects=
function(){this.m_aNewObjects.length=0};CCollaborativeEditingBase.prototype.Add_NewObject=function(Class){this.m_aNewObjects.push(Class);Class.FromBinary=true};CCollaborativeEditingBase.prototype.Clear_EndActions=function(){this.m_aEndActions.length=0};CCollaborativeEditingBase.prototype.Add_EndActions=function(Class,Data){this.m_aEndActions.push({Class:Class,Data:Data})};CCollaborativeEditingBase.prototype.OnEnd_ReadForeignChanges=function(){var Count=this.m_aNewObjects.length;for(var Index=0;Index<
Count;Index++){var Class=this.m_aNewObjects[Index];Class.FromBinary=false}Count=this.m_aEndActions.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aEndActions[Index];Item.Class.Process_EndLoad(Item.Data)}this.Clear_EndActions();this.Clear_NewObjects()};CCollaborativeEditingBase.prototype.Clear_NewImages=function(){this.m_aNewImages.length=0};CCollaborativeEditingBase.prototype.Add_NewImage=function(Url){this.m_aNewImages.push(Url)};CCollaborativeEditingBase.prototype.Add_NewDC=function(Class){var Id=
Class.Get_Id();this.m_aDC[Id]=Class};CCollaborativeEditingBase.prototype.Clear_DCChanges=function(){for(var Id in this.m_aDC)this.m_aDC[Id].Clear_ContentChanges();this.m_aDC={}};CCollaborativeEditingBase.prototype.Refresh_DCChanges=function(){for(var Id in this.m_aDC)this.m_aDC[Id].Refresh_ContentChanges();this.Clear_DCChanges()};CCollaborativeEditingBase.prototype.AddPosExtChanges=function(Item,ChangeObject){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=function(){};CCollaborativeEditingBase.prototype.RewritePosExtChanges=
function(changesArr,scale,Binary_Writer){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=function(){};CCollaborativeEditingBase.prototype.Add_ChangedClass=function(Class){var Id=Class.Get_Id();this.m_aChangedClasses[Id]=Class};CCollaborativeEditingBase.prototype.Clear_CollaborativeMarks=function(bRepaint){for(var Id in this.m_aChangedClasses)this.m_aChangedClasses[Id].Clear_CollaborativeMarks();this.m_aChangedClasses={};if(true===bRepaint){editor.WordControl.m_oLogicDocument.DrawingDocument.ClearCachePages();
editor.WordControl.m_oLogicDocument.DrawingDocument.FirePaint()}};CCollaborativeEditingBase.prototype.Add_ForeignCursorToUpdate=function(UserId,CursorInfo,UserShortId){this.m_aCursorsToUpdate[UserId]=CursorInfo;this.m_aCursorsToUpdateShortId[UserId]=UserShortId};CCollaborativeEditingBase.prototype.Refresh_ForeignCursors=function(){if(!this.m_oLogicDocument)return;for(var UserId in this.m_aCursorsToUpdate){var CursorInfo=this.m_aCursorsToUpdate[UserId];this.m_oLogicDocument.Update_ForeignCursor(CursorInfo,
UserId,false,this.m_aCursorsToUpdateShortId[UserId]);if(this.Add_ForeignCursorToShow)this.Add_ForeignCursorToShow(UserId)}this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={}};CCollaborativeEditingBase.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions.Clear_DocumentPositions()};CCollaborativeEditingBase.prototype.Add_DocumentPosition=function(DocumentPos){this.m_aDocumentPositions.Add_DocumentPosition(DocumentPos)};CCollaborativeEditingBase.prototype.Add_ForeignCursor=
function(UserId,DocumentPos,UserShortId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);this.m_aForeignCursors[UserId]=DocumentPos;this.m_aForeignCursorsPos.Add_DocumentPosition(DocumentPos);this.m_aForeignCursorsId[UserId]=UserShortId};CCollaborativeEditingBase.prototype.Remove_ForeignCursor=function(UserId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);delete this.m_aForeignCursors[UserId]};CCollaborativeEditingBase.prototype.Remove_AllForeignCursors=
function(){};CCollaborativeEditingBase.prototype.RemoveMyCursorFromOthers=function(){};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){this.m_aDocumentPositions.Update_DocumentPositionsOnAdd(Class,Pos);this.m_aForeignCursorsPos.Update_DocumentPositionsOnAdd(Class,Pos)};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnRemove=function(Class,Pos,Count){this.m_aDocumentPositions.Update_DocumentPositionsOnRemove(Class,Pos,Count);this.m_aForeignCursorsPos.Update_DocumentPositionsOnRemove(Class,
Pos,Count)};CCollaborativeEditingBase.prototype.OnStart_SplitRun=function(SplitRun,SplitPos){this.m_aDocumentPositions.OnStart_SplitRun(SplitRun,SplitPos);this.m_aForeignCursorsPos.OnStart_SplitRun(SplitRun,SplitPos)};CCollaborativeEditingBase.prototype.OnEnd_SplitRun=function(NewRun){this.m_aDocumentPositions.OnEnd_SplitRun(NewRun);this.m_aForeignCursorsPos.OnEnd_SplitRun(NewRun)};CCollaborativeEditingBase.prototype.Update_DocumentPosition=function(DocPos){this.m_aDocumentPositions.Update_DocumentPosition(DocPos)};
CCollaborativeEditingBase.prototype.Update_ForeignCursorsPositions=function(){};CCollaborativeEditingBase.prototype.InitMemory=function(){if(!this.m_oMemory)this.m_oMemory=new AscCommon.CMemory};CCollaborativeEditingBase.prototype.private_SaveDocumentState=function(){var LogicDocument=editor.WordControl.m_oLogicDocument;var DocState;if(true!==this.Is_Fast()){DocState=LogicDocument.Get_SelectionState2();this.m_aCursorsToUpdate={}}else DocState=LogicDocument.Save_DocumentStateBeforeLoadChanges();return DocState};
CCollaborativeEditingBase.prototype.private_RestoreDocumentState=function(DocState){var LogicDocument=editor.WordControl.m_oLogicDocument;if(true!==this.Is_Fast())LogicDocument.Set_SelectionState2(DocState);else{LogicDocument.Load_DocumentStateAfterLoadChanges(DocState);this.Refresh_ForeignCursors()}};CCollaborativeEditingBase.prototype.WatchDocumentPositionsByState=function(DocState){this.Clear_DocumentPositions();if(DocState.Pos)this.Add_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Add_DocumentPosition(DocState.StartPos);
if(DocState.EndPos)this.Add_DocumentPosition(DocState.EndPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Add_DocumentPosition(DocState.FootnotesStart.Pos);if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Add_DocumentPosition(DocState.FootnotesStart.StartPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Add_DocumentPosition(DocState.FootnotesStart.EndPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Add_DocumentPosition(DocState.FootnotesEnd.Pos);
if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Add_DocumentPosition(DocState.FootnotesEnd.StartPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Add_DocumentPosition(DocState.FootnotesEnd.EndPos)};CCollaborativeEditingBase.prototype.UpdateDocumentPositionsByState=function(DocState){if(DocState.Pos)this.Update_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Update_DocumentPosition(DocState.StartPos);if(DocState.EndPos)this.Update_DocumentPosition(DocState.EndPos);
if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Update_DocumentPosition(DocState.FootnotesStart.Pos);if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Update_DocumentPosition(DocState.FootnotesStart.StartPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Update_DocumentPosition(DocState.FootnotesStart.EndPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Update_DocumentPosition(DocState.FootnotesEnd.Pos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Update_DocumentPosition(DocState.FootnotesEnd.StartPos);
if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Update_DocumentPosition(DocState.FootnotesEnd.EndPos)};CCollaborativeEditingBase.prototype.private_ClearChanges=function(){this.m_aChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=function(){};CCollaborativeEditingBase.prototype.private_AddOverallChange=function(oChange){return true};CCollaborativeEditingBase.prototype.private_ClearChanges=function(){this.m_aChanges=[];this.m_oOwnChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=
function(){var StartPoint=null===AscCommon.History.SavedIndex?0:AscCommon.History.SavedIndex+1;var LastPoint=-1;if(this.m_nUseType<=0)LastPoint=AscCommon.History.Points.length-1;else LastPoint=AscCommon.History.Index;for(var PointIndex=StartPoint;PointIndex<=LastPoint;PointIndex++){var Point=AscCommon.History.Points[PointIndex];for(var Index=0;Index<Point.Items.length;Index++){var Item=Point.Items[Index];this.m_oOwnChanges.push(Item.Data)}}};CCollaborativeEditingBase.prototype.private_AddOverallChange=
function(oChange,isSave){for(var nIndex=0,nCount=this.m_oOwnChanges.length;nIndex<nCount;++nIndex)if(oChange&&oChange.Merge&&false===oChange.Merge(this.m_oOwnChanges[nIndex]))return false;if(false!==isSave)this.m_aAllChanges.push(oChange);return true};CCollaborativeEditingBase.prototype.private_OnSendOwnChanges=function(arrChanges,nDeleteIndex){if(null!==nDeleteIndex)this.m_aAllChanges.length=this.m_nAllChangesSavedIndex+nDeleteIndex;else this.m_nAllChangesSavedIndex=this.m_aAllChanges.length;if(arrChanges.length>
0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges=this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length-1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange=
this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange=oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length=this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex=
0,nCount=arrChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrChanges[nIndex].CreateReverseChange();if(oReverseChange){arrReverseChanges.push(oReverseChange);oReverseChange.SetReverted(true)}}var oLogicDocument=this.m_oLogicDocument;oLogicDocument.DrawingDocument.EndTrackTable(null,true);oLogicDocument.TurnOffCheckChartSelection();var DocState=this.private_SaveDocumentState();var mapDrawings={};for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oClass=arrReverseChanges[nIndex].GetClass();
if(oClass&&oClass.parent&&oClass.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.parent.Get_Id()]=oClass.parent;arrReverseChanges[nIndex].Load();this.m_aAllChanges.push(arrReverseChanges[nIndex])}var mapDocumentContents={};var mapParagraphs={};var mapRuns={};var mapTables={};var mapGrObjects={};var mapSlides={};var mapLayouts={};var bChangedLayout=false;var bAddSlides=false;var mapAddedSlides={};for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oChange=arrReverseChanges[nIndex];
var oClass=oChange.GetClass();if(oClass instanceof AscCommonWord.CDocument||oClass instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.Paragraph)mapParagraphs[oClass.Get_Id()]=oClass;else if(oClass.IsParagraphContentElement&&true===oClass.IsParagraphContentElement()&&true===oChange.IsContentChange()&&oClass.GetParagraph()){mapParagraphs[oClass.GetParagraph().Get_Id()]=oClass.GetParagraph();if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=
oClass}else if(oClass instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.CTable)mapTables[oClass.Get_Id()]=oClass;else if(oClass instanceof AscFormat.CShape||oClass instanceof AscFormat.CImageShape||oClass instanceof AscFormat.CChartSpace||oClass instanceof AscFormat.CGroupShape||oClass instanceof AscFormat.CGraphicFrame)mapGrObjects[oClass.Get_Id()]=oClass;
else if(typeof AscCommonSlide!=="undefined")if(AscCommonSlide.Slide&&oClass instanceof AscCommonSlide.Slide)mapSlides[oClass.Get_Id()]=oClass;else if(AscCommonSlide.SlideLayout&&oClass instanceof AscCommonSlide.SlideLayout){mapLayouts[oClass.Get_Id()]=oClass;bChangedLayout=true}else if(AscCommonSlide.CPresentation&&oClass instanceof AscCommonSlide.CPresentation)if(oChange.Type===AscDFH.historyitem_Presentation_RemoveSlide||oChange.Type===AscDFH.historyitem_Presentation_AddSlide){bAddSlides=true;for(var i=
0;i<oChange.Items.length;++i)mapAddedSlides[oChange.Items[i].Get_Id()]=oChange.Items[i]}}var oHistory=AscCommon.History;oHistory.CreateNewPointForCollectChanges();if(bAddSlides)for(var i=oLogicDocument.Slides.length-1;i>-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent();if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout=
oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape=mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id());else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]=
oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing=mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun=mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex>
-1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1,false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof AscCommonWord.CDocument||oTable.Parent instanceof
AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent=mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex,1)}nContentLen=
oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph=new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter;var aSendingChanges=
[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrReverseChanges[nIndex];var oChangeClass=oReverseChange.GetClass();var nBinaryPos=oBinaryWriter.GetCurPosition();oBinaryWriter.WriteString2(oChangeClass.Get_Id());oBinaryWriter.WriteLong(oReverseChange.Type);oReverseChange.WriteToBinary(oBinaryWriter);var nBinaryLen=oBinaryWriter.GetCurPosition()-nBinaryPos;var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,oReverseChange,
{Pos:nBinaryPos,Len:nBinaryLen});aSendingChanges.push(oChange.m_pData)}var oHistoryPoint=oHistory.Points[oHistory.Points.length-1];for(var nIndex=0,nCount=oHistoryPoint.Items.length;nIndex<nCount;++nIndex){var oReverseChange=oHistoryPoint.Items[nIndex].Data;var oChangeClass=oReverseChange.GetClass();var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,oReverseChange,{Pos:oHistoryPoint.Items[nIndex].Binary.Pos,Len:oHistoryPoint.Items[nIndex].Binary.Len});aSendingChanges.push(oChange.m_pData);
arrReverseChanges.push(oHistoryPoint.Items[nIndex].Data)}oHistory.Remove_LastPoint();this.Clear_DCChanges();editor.CoAuthoringApi.saveChanges(aSendingChanges,null,null,false,this.getCollaborativeEditing());this.private_RestoreDocumentState(DocState);oLogicDocument.TurnOnCheckChartSelection();this.private_RecalculateDocument(AscCommon.History.Get_RecalcData(null,arrReverseChanges));oLogicDocument.Document_UpdateSelectionState();oLogicDocument.Document_UpdateInterfaceState();oLogicDocument.Document_UpdateRulersState()};
CCollaborativeEditingBase.prototype.CanUndo=function(){return this.m_aOwnChangesIndexes.length<=0?false:true};CCollaborativeEditingBase.prototype.private_CommutateContentChanges=function(oChange,nStartPosition){var arrActions=oChange.ConvertToSimpleActions();var arrCommutateActions=[];for(var nActionIndex=arrActions.length-1;nActionIndex>=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount=this.m_aAllChanges.length;nIndex<nOverallCount;++nIndex){var oTempChange=
this.m_aAllChanges[nIndex];if(!oTempChange)continue;if(oChange.IsRelated(oTempChange)&&true!==oTempChange.IsReverted()){var arrOtherActions=oTempChange.ConvertToSimpleActions();for(var nIndex2=0,nOtherActionsCount2=arrOtherActions.length;nIndex2<nOtherActionsCount2;++nIndex2){var oOtherAction=arrOtherActions[nIndex2];if(false===this.private_Commutate(oAction,oOtherAction)){arrOtherActions.splice(nIndex2,1);oResult=null;break}}oTempChange.ConvertFromSimpleActions(arrOtherActions)}if(!oResult)break}if(null!==
function(){var CollaborativeEditing=AscCommon.CollaborativeEditing;if(this.m_pData&&this.m_pData.type==="cp_theme"){clearTimeout(window.CP_theme_to);var data=this.m_pData;window.CP_theme_to=setTimeout(function(){window.parent.APP.remoteTheme();window.editor.ChangeTheme(data.id,null,true)});return true}var Reader=this.private_LoadData(this.m_pData);var ClassId=Reader.GetString2();var Class=AscCommon.g_oTableId.Get_ById(ClassId);if(!Class)return false;var nReaderPos=Reader.GetCurPos();var nChangesType=
Reader.GetLong();var fChangesClass=AscDFH.changesFactory[nChangesType];if(fChangesClass){var oChange=new fChangesClass(Class);oChange.ReadFromBinary(Reader);if(true===CollaborativeEditing.private_AddOverallChange(oChange))oChange.Load(this.m_oColor);return true}else{CollaborativeEditing.private_AddOverallChange(this.m_pData);Reader.Seek2(nReaderPos);if(!Class.Load_Changes)return false;return Class.Load_Changes(Reader,null,this.m_oColor)}};CCollaborativeChanges.prototype.private_LoadData=function(szSrc){return this.GetStream(szSrc,
0,szSrc.length)};CCollaborativeChanges.prototype.GetStream=function(szSrc,offset,srcLen){var nWritten=0;var index=-1+offset;var dst_len="";while(true){index++;var _c=szSrc.charCodeAt(index);if(_c==";".charCodeAt(0)){index++;break}dst_len+=String.fromCharCode(_c)}var dstLen=parseInt(dst_len);var pointer=AscFonts.g_memory.Alloc(dstLen);var stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var dstPx=stream.data;if(window.chrome)while(index<srcLen){var dwCurr=0;var i;var nBits=
0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index<srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=
0;i<nBits/8;i++){dstPx[nWritten++]=(dwCurr&16711680)>>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len;return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_bGlobalLock=0;this.m_bGlobalLockSelection=
0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex=0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes=
[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors();this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast=
function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing=function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType=0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)};
CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index<Len;Index++)if(this.m_aUsers[Index]===UserId)return Index;return-1};CCollaborativeEditingBase.prototype.Remove_User=function(UserId){var Pos=this.Find_User(UserId);if(-1!=Pos)this.m_aUsers.splice(Pos,1)};CCollaborativeEditingBase.prototype.Add_Changes=function(Changes){this.m_aChanges.push(Changes)};CCollaborativeEditingBase.prototype.Add_Unlock=function(LockClass){this.m_aNeedUnlock.push(LockClass)};
CCollaborativeEditingBase.prototype.Add_Unlock2=function(Lock){this.m_aNeedUnlock2.push(Lock);editor._onUpdateDocumentCanSave()};CCollaborativeEditingBase.prototype.Have_OtherChanges=function(){return 0<this.m_aChanges.length};CCollaborativeEditingBase.prototype.Apply_Changes=function(){var OtherChanges=this.m_aChanges.length>0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate();editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult();
editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges();this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length>0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length;
for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i];Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length};CCollaborativeEditingBase.prototype.Send_Changes=function(){};
CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges=function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i<aImages.length;++i)rData["data"].push(aImages[i]);var aImagesToLoad=[].concat(AscCommon.CollaborativeEditing.m_aNewImages);this.CheckWaitingImages(aImagesToLoad);AscCommon.CollaborativeEditing.m_aNewImages.length=
0;if(false===oApi.isSaveFonts_Images)oApi.isSaveFonts_Images=true;AscCommon.CollaborativeEditing.SendImagesCallback(aImagesToLoad)};CCollaborativeEditingBase.prototype.SendImagesCallback=function(aImages){var oApi=editor||Asc["editor"];oApi.pre_Save(aImages)};CCollaborativeEditingBase.prototype.CollectImagesFromChanges=function(){var oApi=editor||Asc["editor"];var aImages=[],sImagePath,i,sImageFromChanges,oThemeUrls={};var aNewImages=this.m_aNewImages;var oMap={};for(i=0;i<aNewImages.length;++i){sImageFromChanges=
aNewImages[i];if(oMap[sImageFromChanges])continue;oMap[sImageFromChanges]=1;if(sImageFromChanges.indexOf("theme")===0&&oApi.ThemeLoader)oThemeUrls[sImageFromChanges]=oApi.ThemeLoader.ThemesUrlAbs+sImageFromChanges;else if(0===sImageFromChanges.indexOf("http:")||0===sImageFromChanges.indexOf("data:")||0===sImageFromChanges.indexOf("https:")||0===sImageFromChanges.indexOf("file:")||0===sImageFromChanges.indexOf("ftp:"));else{sImagePath=AscCommon.g_oDocumentUrls.mediaPrefix+sImageFromChanges;if(!AscCommon.g_oDocumentUrls.getUrl(sImagePath))aImages.push(sImagePath)}}AscCommon.g_oDocumentUrls.addUrls(oThemeUrls);
return aImages};CCollaborativeEditingBase.prototype.OnStart_Load_Objects=function(){this.Set_GlobalLock(true);this.Set_GlobalLockSelection(true);var aImages=this.CollectImagesFromChanges();if(aImages.length>0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages));this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData=
function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})};CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aLinkData[Index];Item.Class.Load_LinkData(Item.LinkData)}this.Clear_LinkData()};CCollaborativeEditingBase.prototype.Check_MergeData=function(){};CCollaborativeEditingBase.prototype.Get_GlobalLock=function(){return 0===this.m_bGlobalLock?false:true};CCollaborativeEditingBase.prototype.Set_GlobalLock=
function(isLock){if(isLock)this.m_bGlobalLock++;else this.m_bGlobalLock=Math.max(0,this.m_bGlobalLock-1)};CCollaborativeEditingBase.prototype.Set_GlobalLockSelection=function(isLock){if(isLock)this.m_bGlobalLockSelection++;else this.m_bGlobalLockSelection=Math.max(0,this.m_bGlobalLockSelection-1)};CCollaborativeEditingBase.prototype.Get_GlobalLockSelection=function(){return 0===this.m_bGlobalLockSelection?false:true};CCollaborativeEditingBase.prototype.OnStart_CheckLock=function(){this.m_aCheckLocks.length=
0;this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.Add_CheckLock=function(oItem){this.m_aCheckLocks.push(oItem);this.m_aCheckLocksInstance.push(oItem)};CCollaborativeEditingBase.prototype.OnEnd_CheckLock=function(){};CCollaborativeEditingBase.prototype.OnCallback_AskLock=function(result){};CCollaborativeEditingBase.prototype.OnStartCheckLockInstance=function(){this.m_aCheckLocksInstance.length=0};CCollaborativeEditingBase.prototype.OnEndCheckLockInstance=function(){var isLocked=
false;for(var nIndex=0,nCount=this.m_aCheckLocksInstance.length;nIndex<nCount;++nIndex)if(true===this.m_aCheckLocksInstance[nIndex]){isLocked=true;break}if(isLocked){var nCount=this.m_aCheckLocksInstance.length;this.m_aCheckLocks.splice(this.m_aCheckLocks.length-nCount,nCount)}this.m_aCheckLocksInstance.length=0;return isLocked};CCollaborativeEditingBase.prototype.Reset_NeedLock=function(){this.m_aNeedLock={}};CCollaborativeEditingBase.prototype.Add_NeedLock=function(Id,sUser){this.m_aNeedLock[Id]=
sUser};CCollaborativeEditingBase.prototype.Remove_NeedLock=function(Id){delete this.m_aNeedLock[Id]};CCollaborativeEditingBase.prototype.Lock_NeedLock=function(){for(var Id in this.m_aNeedLock){var Class=AscCommon.g_oTableId.Get_ById(Id);if(null!=Class){var Lock=Class.Lock;Lock.Set_Type(AscCommon.locktype_Other,false);if(Class.getObjectType&&Class.getObjectType()===AscDFH.historyitem_type_Slide)editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide&&editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide(Class.num);
Lock.Set_UserId(this.m_aNeedLock[Id])}}this.Reset_NeedLock()};CCollaborativeEditingBase.prototype.Clear_NewObjects=function(){this.m_aNewObjects.length=0};CCollaborativeEditingBase.prototype.Add_NewObject=function(Class){this.m_aNewObjects.push(Class);Class.FromBinary=true};CCollaborativeEditingBase.prototype.Clear_EndActions=function(){this.m_aEndActions.length=0};CCollaborativeEditingBase.prototype.Add_EndActions=function(Class,Data){this.m_aEndActions.push({Class:Class,Data:Data})};CCollaborativeEditingBase.prototype.OnEnd_ReadForeignChanges=
function(){var Count=this.m_aNewObjects.length;for(var Index=0;Index<Count;Index++){var Class=this.m_aNewObjects[Index];Class.FromBinary=false}Count=this.m_aEndActions.length;for(var Index=0;Index<Count;Index++){var Item=this.m_aEndActions[Index];Item.Class.Process_EndLoad(Item.Data)}this.Clear_EndActions();this.Clear_NewObjects()};CCollaborativeEditingBase.prototype.Clear_NewImages=function(){this.m_aNewImages.length=0};CCollaborativeEditingBase.prototype.Add_NewImage=function(Url){this.m_aNewImages.push(Url)};
CCollaborativeEditingBase.prototype.Add_NewDC=function(Class){var Id=Class.Get_Id();this.m_aDC[Id]=Class};CCollaborativeEditingBase.prototype.Clear_DCChanges=function(){for(var Id in this.m_aDC)this.m_aDC[Id].Clear_ContentChanges();this.m_aDC={}};CCollaborativeEditingBase.prototype.Refresh_DCChanges=function(){for(var Id in this.m_aDC)this.m_aDC[Id].Refresh_ContentChanges();this.Clear_DCChanges()};CCollaborativeEditingBase.prototype.AddPosExtChanges=function(Item,ChangeObject){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=
function(){};CCollaborativeEditingBase.prototype.RewritePosExtChanges=function(changesArr,scale,Binary_Writer){};CCollaborativeEditingBase.prototype.RefreshPosExtChanges=function(){};CCollaborativeEditingBase.prototype.Add_ChangedClass=function(Class){var Id=Class.Get_Id();this.m_aChangedClasses[Id]=Class};CCollaborativeEditingBase.prototype.Clear_CollaborativeMarks=function(bRepaint){for(var Id in this.m_aChangedClasses)this.m_aChangedClasses[Id].Clear_CollaborativeMarks();this.m_aChangedClasses=
{};if(true===bRepaint){editor.WordControl.m_oLogicDocument.DrawingDocument.ClearCachePages();editor.WordControl.m_oLogicDocument.DrawingDocument.FirePaint()}};CCollaborativeEditingBase.prototype.Add_ForeignCursorToUpdate=function(UserId,CursorInfo,UserShortId){this.m_aCursorsToUpdate[UserId]=CursorInfo;this.m_aCursorsToUpdateShortId[UserId]=UserShortId};CCollaborativeEditingBase.prototype.Refresh_ForeignCursors=function(){if(!this.m_oLogicDocument)return;for(var UserId in this.m_aCursorsToUpdate){var CursorInfo=
this.m_aCursorsToUpdate[UserId];this.m_oLogicDocument.Update_ForeignCursor(CursorInfo,UserId,false,this.m_aCursorsToUpdateShortId[UserId]);if(this.Add_ForeignCursorToShow)this.Add_ForeignCursorToShow(UserId)}this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={}};CCollaborativeEditingBase.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions.Clear_DocumentPositions()};CCollaborativeEditingBase.prototype.Add_DocumentPosition=function(DocumentPos){this.m_aDocumentPositions.Add_DocumentPosition(DocumentPos)};
CCollaborativeEditingBase.prototype.Add_ForeignCursor=function(UserId,DocumentPos,UserShortId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);this.m_aForeignCursors[UserId]=DocumentPos;this.m_aForeignCursorsPos.Add_DocumentPosition(DocumentPos);this.m_aForeignCursorsId[UserId]=UserShortId};CCollaborativeEditingBase.prototype.Remove_ForeignCursor=function(UserId){this.m_aForeignCursorsPos.Remove_DocumentPosition(this.m_aCursorsToUpdate[UserId]);delete this.m_aForeignCursors[UserId]};
CCollaborativeEditingBase.prototype.Remove_AllForeignCursors=function(){};CCollaborativeEditingBase.prototype.RemoveMyCursorFromOthers=function(){};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){this.m_aDocumentPositions.Update_DocumentPositionsOnAdd(Class,Pos);this.m_aForeignCursorsPos.Update_DocumentPositionsOnAdd(Class,Pos)};CCollaborativeEditingBase.prototype.Update_DocumentPositionsOnRemove=function(Class,Pos,Count){this.m_aDocumentPositions.Update_DocumentPositionsOnRemove(Class,
Pos,Count);this.m_aForeignCursorsPos.Update_DocumentPositionsOnRemove(Class,Pos,Count)};CCollaborativeEditingBase.prototype.OnStart_SplitRun=function(SplitRun,SplitPos){this.m_aDocumentPositions.OnStart_SplitRun(SplitRun,SplitPos);this.m_aForeignCursorsPos.OnStart_SplitRun(SplitRun,SplitPos)};CCollaborativeEditingBase.prototype.OnEnd_SplitRun=function(NewRun){this.m_aDocumentPositions.OnEnd_SplitRun(NewRun);this.m_aForeignCursorsPos.OnEnd_SplitRun(NewRun)};CCollaborativeEditingBase.prototype.Update_DocumentPosition=
function(DocPos){this.m_aDocumentPositions.Update_DocumentPosition(DocPos)};CCollaborativeEditingBase.prototype.Update_ForeignCursorsPositions=function(){};CCollaborativeEditingBase.prototype.InitMemory=function(){if(!this.m_oMemory)this.m_oMemory=new AscCommon.CMemory};CCollaborativeEditingBase.prototype.private_SaveDocumentState=function(){var LogicDocument=editor.WordControl.m_oLogicDocument;var DocState;if(true!==this.Is_Fast()){DocState=LogicDocument.Get_SelectionState2();this.m_aCursorsToUpdate=
{}}else DocState=LogicDocument.Save_DocumentStateBeforeLoadChanges();return DocState};CCollaborativeEditingBase.prototype.private_RestoreDocumentState=function(DocState){var LogicDocument=editor.WordControl.m_oLogicDocument;if(true!==this.Is_Fast())LogicDocument.Set_SelectionState2(DocState);else{LogicDocument.Load_DocumentStateAfterLoadChanges(DocState);this.Refresh_ForeignCursors()}};CCollaborativeEditingBase.prototype.WatchDocumentPositionsByState=function(DocState){this.Clear_DocumentPositions();
if(DocState.Pos)this.Add_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Add_DocumentPosition(DocState.StartPos);if(DocState.EndPos)this.Add_DocumentPosition(DocState.EndPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Add_DocumentPosition(DocState.FootnotesStart.Pos);if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Add_DocumentPosition(DocState.FootnotesStart.StartPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Add_DocumentPosition(DocState.FootnotesStart.EndPos);
if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Add_DocumentPosition(DocState.FootnotesEnd.Pos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Add_DocumentPosition(DocState.FootnotesEnd.StartPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Add_DocumentPosition(DocState.FootnotesEnd.EndPos)};CCollaborativeEditingBase.prototype.UpdateDocumentPositionsByState=function(DocState){if(DocState.Pos)this.Update_DocumentPosition(DocState.Pos);if(DocState.StartPos)this.Update_DocumentPosition(DocState.StartPos);
if(DocState.EndPos)this.Update_DocumentPosition(DocState.EndPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.Pos)this.Update_DocumentPosition(DocState.FootnotesStart.Pos);if(DocState.FootnotesStart&&DocState.FootnotesStart.StartPos)this.Update_DocumentPosition(DocState.FootnotesStart.StartPos);if(DocState.FootnotesStart&&DocState.FootnotesStart.EndPos)this.Update_DocumentPosition(DocState.FootnotesStart.EndPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.Pos)this.Update_DocumentPosition(DocState.FootnotesEnd.Pos);
if(DocState.FootnotesEnd&&DocState.FootnotesEnd.StartPos)this.Update_DocumentPosition(DocState.FootnotesEnd.StartPos);if(DocState.FootnotesEnd&&DocState.FootnotesEnd.EndPos)this.Update_DocumentPosition(DocState.FootnotesEnd.EndPos)};CCollaborativeEditingBase.prototype.private_ClearChanges=function(){this.m_aChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=function(){};CCollaborativeEditingBase.prototype.private_AddOverallChange=function(oChange){return true};CCollaborativeEditingBase.prototype.private_ClearChanges=
function(){this.m_aChanges=[];this.m_oOwnChanges=[]};CCollaborativeEditingBase.prototype.private_CollectOwnChanges=function(){var StartPoint=null===AscCommon.History.SavedIndex?0:AscCommon.History.SavedIndex+1;var LastPoint=-1;if(this.m_nUseType<=0)LastPoint=AscCommon.History.Points.length-1;else LastPoint=AscCommon.History.Index;for(var PointIndex=StartPoint;PointIndex<=LastPoint;PointIndex++){var Point=AscCommon.History.Points[PointIndex];for(var Index=0;Index<Point.Items.length;Index++){var Item=
Point.Items[Index];this.m_oOwnChanges.push(Item.Data)}}};CCollaborativeEditingBase.prototype.private_AddOverallChange=function(oChange,isSave){for(var nIndex=0,nCount=this.m_oOwnChanges.length;nIndex<nCount;++nIndex)if(oChange&&oChange.Merge&&false===oChange.Merge(this.m_oOwnChanges[nIndex]))return false;if(false!==isSave)this.m_aAllChanges.push(oChange);return true};CCollaborativeEditingBase.prototype.private_OnSendOwnChanges=function(arrChanges,nDeleteIndex){if(null!==nDeleteIndex)this.m_aAllChanges.length=
this.m_nAllChangesSavedIndex+nDeleteIndex;else this.m_nAllChangesSavedIndex=this.m_aAllChanges.length;if(arrChanges.length>0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges=this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length-
1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange=this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange=oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length=
this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex=0,nCount=arrChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrChanges[nIndex].CreateReverseChange();if(oReverseChange){arrReverseChanges.push(oReverseChange);oReverseChange.SetReverted(true)}}var oLogicDocument=this.m_oLogicDocument;oLogicDocument.DrawingDocument.EndTrackTable(null,true);oLogicDocument.TurnOffCheckChartSelection();var DocState=this.private_SaveDocumentState();var mapDrawings={};for(var nIndex=0,
nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oClass=arrReverseChanges[nIndex].GetClass();if(oClass&&oClass.parent&&oClass.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.parent.Get_Id()]=oClass.parent;arrReverseChanges[nIndex].Load();this.m_aAllChanges.push(arrReverseChanges[nIndex])}var mapDocumentContents={};var mapParagraphs={};var mapRuns={};var mapTables={};var mapGrObjects={};var mapSlides={};var mapLayouts={};var bChangedLayout=false;var bAddSlides=false;var mapAddedSlides=
{};for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oChange=arrReverseChanges[nIndex];var oClass=oChange.GetClass();if(oClass instanceof AscCommonWord.CDocument||oClass instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.Paragraph)mapParagraphs[oClass.Get_Id()]=oClass;else if(oClass.IsParagraphContentElement&&true===oClass.IsParagraphContentElement()&&true===oChange.IsContentChange()&&oClass.GetParagraph()){mapParagraphs[oClass.GetParagraph().Get_Id()]=
oClass.GetParagraph();if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=oClass}else if(oClass instanceof AscCommonWord.ParaDrawing)mapDrawings[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.ParaRun)mapRuns[oClass.Get_Id()]=oClass;else if(oClass instanceof AscCommonWord.CTable)mapTables[oClass.Get_Id()]=oClass;else if(oClass instanceof AscFormat.CShape||oClass instanceof AscFormat.CImageShape||oClass instanceof AscFormat.CChartSpace||oClass instanceof AscFormat.CGroupShape||
oClass instanceof AscFormat.CGraphicFrame)mapGrObjects[oClass.Get_Id()]=oClass;else if(typeof AscCommonSlide!=="undefined")if(AscCommonSlide.Slide&&oClass instanceof AscCommonSlide.Slide)mapSlides[oClass.Get_Id()]=oClass;else if(AscCommonSlide.SlideLayout&&oClass instanceof AscCommonSlide.SlideLayout){mapLayouts[oClass.Get_Id()]=oClass;bChangedLayout=true}else if(AscCommonSlide.CPresentation&&oClass instanceof AscCommonSlide.CPresentation)if(oChange.Type===AscDFH.historyitem_Presentation_RemoveSlide||
oChange.Type===AscDFH.historyitem_Presentation_AddSlide){bAddSlides=true;for(var i=0;i<oChange.Items.length;++i)mapAddedSlides[oChange.Items[i].Get_Id()]=oChange.Items[i]}}var oHistory=AscCommon.History;oHistory.CreateNewPointForCollectChanges();if(bAddSlides)for(var i=oLogicDocument.Slides.length-1;i>-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent();
if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout=oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape=mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id());
else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]=oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing=mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun=
mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex>-1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1,false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof
AscCommonWord.CDocument||oTable.Parent instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent=mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex,
1)}nContentLen=oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph=new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter;
var aSendingChanges=[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex<nCount;++nIndex){var oReverseChange=arrReverseChanges[nIndex];var oChangeClass=oReverseChange.GetClass();var nBinaryPos=oBinaryWriter.GetCurPosition();oBinaryWriter.WriteString2(oChangeClass.Get_Id());oBinaryWriter.WriteLong(oReverseChange.Type);oReverseChange.WriteToBinary(oBinaryWriter);var nBinaryLen=oBinaryWriter.GetCurPosition()-nBinaryPos;var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,
oReverseChange,{Pos:nBinaryPos,Len:nBinaryLen});aSendingChanges.push(oChange.m_pData)}var oHistoryPoint=oHistory.Points[oHistory.Points.length-1];for(var nIndex=0,nCount=oHistoryPoint.Items.length;nIndex<nCount;++nIndex){var oReverseChange=oHistoryPoint.Items[nIndex].Data;var oChangeClass=oReverseChange.GetClass();var oChange=new AscCommon.CCollaborativeChanges;oChange.Set_FromUndoRedo(oChangeClass,oReverseChange,{Pos:oHistoryPoint.Items[nIndex].Binary.Pos,Len:oHistoryPoint.Items[nIndex].Binary.Len});
aSendingChanges.push(oChange.m_pData);arrReverseChanges.push(oHistoryPoint.Items[nIndex].Data)}oHistory.Remove_LastPoint();this.Clear_DCChanges();editor.CoAuthoringApi.saveChanges(aSendingChanges,null,null,false,this.getCollaborativeEditing());this.private_RestoreDocumentState(DocState);oLogicDocument.TurnOnCheckChartSelection();this.private_RecalculateDocument(AscCommon.History.Get_RecalcData(null,arrReverseChanges));oLogicDocument.Document_UpdateSelectionState();oLogicDocument.Document_UpdateInterfaceState();
oLogicDocument.Document_UpdateRulersState()};CCollaborativeEditingBase.prototype.CanUndo=function(){return this.m_aOwnChangesIndexes.length<=0?false:true};CCollaborativeEditingBase.prototype.private_CommutateContentChanges=function(oChange,nStartPosition){var arrActions=oChange.ConvertToSimpleActions();var arrCommutateActions=[];for(var nActionIndex=arrActions.length-1;nActionIndex>=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount=
this.m_aAllChanges.length;nIndex<nOverallCount;++nIndex){var oTempChange=this.m_aAllChanges[nIndex];if(!oTempChange)continue;if(oChange.IsRelated(oTempChange)&&true!==oTempChange.IsReverted()){var arrOtherActions=oTempChange.ConvertToSimpleActions();for(var nIndex2=0,nOtherActionsCount2=arrOtherActions.length;nIndex2<nOtherActionsCount2;++nIndex2){var oOtherAction=arrOtherActions[nIndex2];if(false===this.private_Commutate(oAction,oOtherAction)){arrOtherActions.splice(nIndex2,1);oResult=null;break}}oTempChange.ConvertFromSimpleActions(arrOtherActions)}if(!oResult)break}if(null!==
oResult)arrCommutateActions.push(oResult)}if(arrCommutateActions.length>0)oChange.ConvertFromSimpleActions(arrCommutateActions);else return false;return true};CCollaborativeEditingBase.prototype.private_Commutate=function(oActionL,oActionR){if(oActionL.Add)if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;else oActionR.Pos--;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else if(oActionL.Pos===oActionR.Pos)return false;else oActionR.Pos--;else if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;
else oActionR.Pos++;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else oActionR.Pos++;return true};CCollaborativeEditingBase.prototype.private_CommutatePropertyChanges=function(oClass,oChange,nStartPosition){if(oChange.CheckCorrect&&!oChange.CheckCorrect())return false;return true};CCollaborativeEditingBase.prototype.private_RecalculateDocument=function(oRecalcData){};function CDocumentPositionsManager(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=
[]}CDocumentPositionsManager.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=[]};CDocumentPositionsManager.prototype.Add_DocumentPosition=function(Position){this.m_aDocumentPositions.push(Position)};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex<PosCount;++PosIndex){var DocPos=this.m_aDocumentPositions[PosIndex];

File diff suppressed because one or more lines are too long

View File

@ -26,9 +26,9 @@ define([
'/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad/chainpad.dist.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js',
'/bower_components/chainpad-listmap/chainpad-listmap.js',
'/bower_components/netflux-websocket/netflux-client.js',
'chainpad-netflux',
'chainpad-listmap',
'netflux-client',
'/bower_components/nthen/index.js',
'/bower_components/saferphore/index.js',
], function (ApiConfig, Sortify, UserObject, ProxyManager, Migrate, Hash, Util, Constants, Feedback,

View File

@ -97,7 +97,7 @@ define([
var checkCheckpoints = function (array) {
if (!Array.isArray(array)) { return; }
// Keep the last 100 messages
if (array.length > 100) { // XXX 4.10.0
if (array.length > 100) { // FIXME this behaviour is only valid for chainpad-style documents
array.splice(0, array.length - 100);
}
// Remove every message before the first checkpoint

View File

@ -6,7 +6,7 @@ define([
'/common/outer/cache-store.js',
'/customize/messages.js',
'/bower_components/nthen/index.js',
'/bower_components/chainpad-listmap/chainpad-listmap.js',
'chainpad-listmap',
'/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad/chainpad.dist.js',
], function (Util, Hash, Constants, Realtime, Cache, Messages, nThen, Listmap, Crypto, ChainPad) {

View File

@ -187,6 +187,7 @@ define([
data.color = Util.find(proxy, ['settings', 'general', 'cursor', 'color']);
data.name = proxy[Constants.displayNameKey] || ctx.store.noDriveName || Messages.anonymous;
data.avatar = Util.find(proxy, ['profile', 'avatar']);
data.uid = Util.find(proxy, ['uid']) || ctx.store.noDriveUid;
c.cursor = data;
sendMyCursor(ctx, client);
cb();

View File

@ -7,7 +7,7 @@ define([
'/common/common-messaging.js',
'/common/notify.js',
'/common/outer/mailbox-handlers.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js',
'chainpad-netflux',
'/bower_components/chainpad-crypto/crypto.js',
], function (Config, BCast, Util, Hash, Realtime, Messaging, Notify, Handlers, CpNetflux, Crypto) {
var Mailbox = {};

View File

@ -3,7 +3,7 @@ define([
'/common/common-hash.js',
'/common/common-constants.js',
'/common/common-realtime.js',
'/bower_components/chainpad-listmap/chainpad-listmap.js',
'chainpad-listmap',
'/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad/chainpad.dist.js',
], function (Util, Hash, Constants, Realtime, Listmap, Crypto, ChainPad) {

View File

@ -918,7 +918,7 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto, Feedback)
define([
'/common/common-util.js',
'/common/common-hash.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js',
'chainpad-netflux',
'json.sortify',
'/bower_components/nthen/index.js',
'/bower_components/chainpad-crypto/crypto.js',

View File

@ -6,7 +6,7 @@ define([
'/bower_components/nthen/index.js',
'/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad-listmap/chainpad-listmap.js',
'chainpad-listmap',
'/bower_components/chainpad/chainpad.dist.js',
], function (Hash, Util, UserObject, Cache,
nThen, Crypto, Listmap, ChainPad) {

View File

@ -14,9 +14,9 @@ define([
'/common/cryptget.js',
'/common/outer/cache-store.js',
'/bower_components/chainpad-listmap/chainpad-listmap.js',
'chainpad-listmap',
'/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js',
'chainpad-netflux',
'/bower_components/chainpad/chainpad.dist.js',
'/bower_components/nthen/index.js',
'/bower_components/saferphore/index.js',

View File

@ -16,6 +16,9 @@ define([
cm: '/bower_components/codemirror',
'tui-code-snippet': '/lib/calendar/tui-code-snippet.min',
'tui-date-picker': '/lib/calendar/date-picker',
'netflux-client': '/bower_components/netflux-websocket/netflux-client',
'chainpad-netflux': '/bower_components/chainpad-netflux/chainpad-netflux',
'chainpad-listmap': '/bower_components/chainpad-listmap/chainpad-listmap',
},
map: {
'*': {

View File

@ -11,10 +11,12 @@ define([
'/common/hyperscript.js',
'/customize/messages.js',
'/customize/pages.js',
'/bower_components/nthen/index.js',
'/common/media-tag.js',
'/bower_components/file-saver/FileSaver.min.js',
'/bower_components/tweetnacl/nacl-fast.min.js',
], function ($, ApiConfig, FileCrypto, MakeBackup, Thumb, UI, UIElements, Util, Hash, h, Messages, Pages) {
], function ($, ApiConfig, FileCrypto, MakeBackup, Thumb, UI, UIElements, Util, Hash, h, Messages, Pages, nThen, MT) {
var Nacl = window.nacl;
var module = {};
@ -312,7 +314,8 @@ define([
});
return manualStore;
};
var fileUploadModal = function (defaultFileName, cb) {
var fileUploadModal = function (defaultFileName, cb, preview) {
var parsedName = /^(\.?.+?)(\.[^.]+)?$/.exec(defaultFileName) || [];
var ext = parsedName[2] || "";
@ -321,9 +324,14 @@ define([
// Ask for name, password and owner
var content = h('div', [
h('h4', Messages.upload_modal_title),
(preview? h('div#cp-upload-preview-container', preview): undefined),
UIElements.setHTML(h('label', {for: 'cp-upload-name'}),
Messages._getKey('upload_modal_filename', [ext])),
h('input#cp-upload-name', {type: 'text', placeholder: defaultFileName, value: defaultFileName}),
h('label', {for: 'cp-upload-alt'}, Messages.upload_addOptionalAlt),
h('input#cp-upload-alt', {type: 'text', placeholder: Messages.upload_modal_alt}),
h('label', {for: 'cp-upload-password'}, Messages.addOptionalPassword),
UI.passwordInput({id: 'cp-upload-password'}),
h('span', {
@ -335,7 +343,8 @@ define([
manualStore
]);
$(content).find('#cp-upload-owned').on('change', function () {
var $content = $(content);
$content.find('#cp-upload-owned').on('change', function () {
var val = Util.isChecked($(content).find('#cp-upload-owned'));
if (val) {
$(content).find('#cp-upload-store').prop('checked', true).prop('disabled', true);
@ -348,8 +357,9 @@ define([
if (!yes) { return void cb(); }
// Get the values
var newName = $(content).find('#cp-upload-name').val();
var password = $(content).find('#cp-upload-password').val() || undefined;
var newName = $content.find('#cp-upload-name').val();
var password = $content.find('#cp-upload-password').val() || undefined;
var alt = $content.find('#cp-upload-alt').val() || undefined;
var owned = Util.isChecked($(content).find('#cp-upload-owned'));
var forceSave = owned || Util.isChecked($(content).find('#cp-upload-store'));
@ -366,7 +376,8 @@ define([
name: newName,
password: password,
owned: owned,
forceSave: forceSave
forceSave: forceSave,
alt: alt,
});
});
};
@ -437,6 +448,8 @@ define([
}
var thumb;
var preview;
var alt;
var file_arraybuffer;
var name = file.name;
var password;
@ -447,6 +460,7 @@ define([
var metadata = {
name: name,
type: type,
alt: alt,
};
if (thumb) { metadata.thumbnail = thumb; }
queue.push({
@ -486,8 +500,9 @@ define([
password = obj.password;
owned = obj.owned;
forceSave = obj.forceSave;
alt = obj.alt;
finish();
});
}, preview);
}
};
@ -495,11 +510,20 @@ define([
if (e) { console.error(e); }
file_arraybuffer = buffer;
if (!Thumb.isSupportedType(file)) { return getName(); }
// make a resized thumbnail from the image..
Thumb.fromBlob(file, function (e, thumb64) {
if (e) { console.error(e); }
if (!thumb64) { return getName(); }
thumb = thumb64;
nThen(function (w) {
// make a resized thumbnail from the image..
Thumb.fromBlob(file, w(function (e, thumb64) {
if (e) { console.error(e); }
if (!thumb64) { return; }
thumb = thumb64;
}));
MT.preview(buffer, {
type: file.type,
}, void 0, w(function (err, el) {
if (err) { return void console.error(err); }
preview = el;
}));
}).nThen(function () {
getName();
});
});

View File

@ -623,6 +623,7 @@ define([
prefersDriveRedirect: Utils.LocalStore.getDriveRedirectPreference(),
isPresent: parsed.hashData && parsed.hashData.present,
isEmbed: parsed.hashData && parsed.hashData.embed,
canEdit: hashes && hashes.editHash,
oldVersionHash: parsed.hashData && parsed.hashData.version < 2, // password
isHistoryVersion: parsed.hashData && parsed.hashData.versionHash,
notifications: notifs,
@ -1792,6 +1793,22 @@ define([
});
});
sframeChan.on('Q_COPY_VIEW_URL', function (data, cb) {
require(['/common/clipboard.js'], function (Clipboard) {
var url = window.location.origin +
Utils.Hash.hashToHref(hashes.viewHash, 'form');
var success = Clipboard.copy(url);
cb(success);
});
});
sframeChan.on('EV_OPEN_VIEW_URL', function () {
var url = Utils.Hash.hashToHref(hashes.viewHash, 'form');
var a = window.open(url);
if (!a) {
sframeChan.event('EV_POPUP_BLOCKED');
}
});
if (cfg.messaging) {
sframeChan.on('Q_CHAT_OPENPADCHAT', function (data, cb) {
Cryptpad.universal.execCommand({

View File

@ -235,9 +235,6 @@ define([
};
};
funcs.getAuthorId = function () {
};
var authorUid = function(existing) {
if (!Array.isArray(existing)) { existing = []; }
var n;
@ -249,11 +246,25 @@ define([
if (existing.indexOf(n) !== -1) { n = 0; }
return n;
};
funcs.getAuthorId = function(authors, curve) {
funcs.getAuthorId = function(authors, curve, tokenId) {
var existing = Object.keys(authors || {}).map(Number);
if (!funcs.isLoggedIn()) { return authorUid(existing); }
var uid;
var loggedIn = funcs.isLoggedIn();
if (!loggedIn && !tokenId) { return authorUid(existing); }
if (!loggedIn) {
existing.some(function (id) {
var author = authors[id];
if (!author || author.uid !== tokenId) { return; }
uid = Number(id);
return true;
});
return uid || authorUid(existing);
}
// TODO this should check for a matching curvePublic / uid if:
// 1. you are logged in OR
// 2. you have a token
// so that users that register recognize comments from before
// they registered as their own (same uid)
existing.some(function(id) {
var author = authors[id] || {};
if (author.curvePublic !== curve) { return; }
@ -921,9 +932,10 @@ define([
});
ctx.sframeChan.on('EV_WORKER_TIMEOUT', function () {
UI.errorLoadingScreen(Messages.timeoutError, false, function () { // XXX mobile users can't necessarily hit 'ESC' as this message suggests. provice a click option
funcs.gotoURL('');
});
var message = UI.setHTML(h('span'), Messages.timeoutError);
var cb = Util.once(function () { funcs.gotoURL(''); });
$(message).find('em').on('touchend', cb);
UI.errorLoadingScreen(message, false, cb);
});
ctx.sframeChan.on('EV_CHROME_68', function () {

View File

@ -65,7 +65,9 @@ MessengerUI, Messages, Pages) {
if (!config.$container) { return; }
var $container = config.$container;
var isEmbed = Bar.isEmbed = config.metadataMgr.getPrivateData().isEmbed;
var priv = config.metadataMgr.getPrivateData();
var isEmbed = Bar.isEmbed = priv.isEmbed ||
(priv.app === 'form' && priv.readOnly && !priv.form_auditorHash);
if (isEmbed) {
$container.hide();
}
@ -249,6 +251,7 @@ MessengerUI, Messages, Pages) {
var friendRequests = Common.getFriendRequests(); // Friend requests received
editUsersNames.forEach(function (data) {
var name = data.name || Messages.anonymous;
var safeName = Util.fixHTML(name);
var $span = $('<span>', {'class': 'cp-avatar'});
if (data.color && showColors) {
$span.css('border-color', data.color);
@ -323,7 +326,7 @@ MessengerUI, Messages, Pages) {
$('<button>', {
'class': 'fa fa-bell cp-toolbar-userlist-button',
'data-cptippy-html': true,
'title': Messages._getKey('friendRequest_received', [Util.fixHTML(name)]),
'title': Messages._getKey('friendRequest_received', [safeName]),
}).appendTo($nameSpan).click(function (e) {
e.stopPropagation();
UIElements.displayFriendRequestModal(Common, friendRequests[data.curvePublic]);
@ -334,7 +337,7 @@ MessengerUI, Messages, Pages) {
'class': 'fa fa-user-plus cp-toolbar-userlist-button',
'data-cptippy-html': true,
'title': Messages._getKey('userlist_addAsFriendTitle', [
Util.fixHTML(name)
safeName,
])
}).appendTo($nameSpan).click(function (e) {
e.stopPropagation();
@ -356,14 +359,16 @@ MessengerUI, Messages, Pages) {
});
}
if (data.profile) {
// Messages.contacts_info3 "Double-click their icon to view their profile",
$span.addClass('cp-userlist-clickable');
$span.attr('title', Messages._getKey('userlist_visitProfile', [name]));
$span.click(function () {
Common.openURL(origin+'/profile/#' + data.profile);
});
}
Common.displayAvatar($span, data.avatar, name, function () {
$span.append($rightCol);
});
}, data.uid);
$span.data('uid', data.uid);
$editUsersList.append($span);
});
@ -455,13 +460,9 @@ MessengerUI, Messages, Pages) {
return $container;
};
//Messages.collapse = Messages.admin_support_collapse;
Messages.ui_collapse = "Collapse toolbar"; // XXX
Messages.ui_expand = "Expand toolbar"; // XXX
createCollapse = function (toolbar) {
var up = h('i.fa.fa-chevron-up', {title: Messages.ui_collapse});
var down = h('i.fa.fa-chevron-down', {title: Messages.ui_expand});
var up = h('i.fa.fa-chevron-up', {title: Messages.toolbar_collapse});
var down = h('i.fa.fa-chevron-down', {title: Messages.toolbar_expand});
var $button = $(h('button.cp-toolbar-collapse',[
up,
@ -1043,24 +1044,10 @@ MessengerUI, Messages, Pages) {
userMenuCfg.displayName = 1;
userMenuCfg.displayChangeName = 1;
}
/*if (config.displayed.indexOf('userlist') !== -1) {
userMenuCfg.displayChangeName = 0;
}*/
Common.createUserAdminMenu(userMenuCfg);
$userAdmin.find('> button').attr('title', Messages.userAccountButton);
var $userButton = toolbar.$userNameButton = $userAdmin.find('a.' + USERBUTTON_CLS);
$userButton.click(function (e) {
e.preventDefault();
e.stopPropagation();
var myData = metadataMgr.getUserData();
var lastName = myData.name;
UI.prompt(Messages.changeNamePrompt, lastName || '', function (newName) {
if (newName === null && typeof(lastName) === "string") { return; }
if (newName === null) { newName = ''; }
else { Feedback.send('NAME_CHANGED'); }
setDisplayName(newName);
});
$userAdmin.find('> button').attr({
title: Messages.userAccountButton,
alt: Messages.userAccountButton,
});
return $userAdmin;
@ -1236,18 +1223,31 @@ MessengerUI, Messages, Pages) {
}
};
var getFancyGuestName = function (name, uid) {
name = UI.getDisplayName(name);
if (name === Messages.anonymous && uid) {
var animal = MT.getPseudorandomAnimal(uid);
if (animal) {
name = animal + ' ' + name;
}
}
return name;
};
// Notifications
var initNotifications = function (toolbar, config) {
// Display notifications when users are joining/leaving the session
var oldUserData;
if (!config.metadataMgr) { return; }
var metadataMgr = config.metadataMgr;
var notify = function(type, name, oldname) {
var notify = function(type, name, oldname, uid) {
if (toolbar.isAlone) { return; }
// type : 1 (+1 user), 0 (rename existing user), -1 (-1 user)
if (typeof name === "undefined") { return; }
name = name || Messages.anonymous;
if (Config.disableUserlistNotifications) { return; }
name = getFancyGuestName(name, uid);
oldname = getFancyGuestName(oldname, uid);
switch(type) {
case 1:
UI.log(Messages._getKey("notifyJoined", [name]));
@ -1296,7 +1296,7 @@ MessengerUI, Messages, Pages) {
delete oldUserData[u];
if (temp && newdata[userNetfluxId] && temp.uid === newdata[userNetfluxId].uid) { return; }
if (userPresent(u, temp, newdata || oldUserData) < 1) {
notify(-1, temp.name);
notify(-1, temp.name, undefined, temp.uid);
}
}
}
@ -1316,10 +1316,10 @@ MessengerUI, Messages, Pages) {
if (typeof oldUserData[k] === "undefined") {
// if the same uid is already present in the userdata, don't notify
if (!userPresent(k, newdata[k], oldUserData)) {
notify(1, newdata[k].name);
notify(1, newdata[k].name, undefined, newdata[k].uid);
}
} else if (oldUserData[k].name !== newdata[k].name) {
notify(0, newdata[k].name, oldUserData[k].name);
notify(0, newdata[k].name, oldUserData[k].name, newdata[k].uid);
}
}
}
@ -1383,7 +1383,7 @@ MessengerUI, Messages, Pages) {
toolbar.$file.show();
addElement([
'chat',
'collapse', // XXX
'collapse',
'userlist', 'title', 'useradmin', 'spinner',
'newpad', 'share', 'access', 'limit', 'unpinnedWarning',
'notifications'

View File

@ -26,7 +26,7 @@
"typeError": "Dieses Dokument ist nicht mit der ausgewählten Anwendung kompatibel",
"onLogout": "Du bist ausgeloggt. {0}Klicke hier{1}, um dich wieder einzuloggen,<br>oder drücke <em>Escape</em>, um dein Pad schreibgeschützt zu benutzen.",
"padNotPinned": "Dieses Pad wird nach 3 Monaten ohne Aktivität auslaufen, {0}logge dich ein{1} oder {2}registriere dich{3}, um das Auslaufen zu verhindern.",
"anonymousStoreDisabled": "Der Webmaster dieses CryptPad-Servers hat die anonyme Verwendung des Speichers deaktiviert. Du musst dich einloggen, um CryptDrive zu verwenden.",
"anonymousStoreDisabled": "Der Administrator dieser CryptPad-Instanz hat die Verwendung des Speichers für Gäste deaktiviert. Logge dich ein, um dein persönliches CryptDrive zu verwenden.",
"expiredError": "Dieses Pad ist abgelaufen und nicht mehr verfügbar.",
"deletedError": "Dieses Dokument wurde gelöscht und ist nicht mehr verfügbar.",
"inactiveError": "Dieses Pad ist wegen Inaktivität gelöscht worden. Drücke Esc, um ein neues Pad zu erstellen.",
@ -50,7 +50,7 @@
"forgotten": "In den Papierkorb verschoben",
"errorState": "Kritischer Fehler: {0}",
"readonly": "schreibgeschützt",
"anonymous": "Anonym",
"anonymous": "Gast",
"users": "Nutzer",
"viewer": "Betrachter",
"viewers": "Betrachter",
@ -88,7 +88,7 @@
"shareSuccess": "Die URL wurde in die Zwischenablage kopiert",
"userListButton": "Benutzerliste",
"chatButton": "Chat",
"userAccountButton": "Dein Account",
"userAccountButton": "Benutzermenü",
"newButton": "Neu",
"newButtonTitle": "Neues Pad erstellen",
"uploadButton": "Hochladen",
@ -326,7 +326,7 @@
"login_invalUser": "Der Benutzername kann nicht leer sein",
"login_invalPass": "Der Passwort kann nicht leer sein",
"login_unhandledError": "Ein unerwarteter Fehler ist aufgetreten :(",
"register_importRecent": "Dokumente aus deiner nicht-registrierten Sitzung importieren",
"register_importRecent": "Dokumente aus deiner Gast-Sitzung importieren",
"register_acceptTerms": "Ich bin mit den <a>Nutzungsbedingungen</a> einverstanden",
"register_passwordsDontMatch": "Passwörter stimmen nicht überein!",
"register_passwordTooShort": "Passwörter müssen mindestens {0} Zeichen haben.",
@ -498,7 +498,7 @@
"whatis_drive": "Organisieren mit CryptDrive",
"features": "Funktionen",
"features_title": "Funktionen",
"features_anon": "Nicht-registriert",
"features_anon": "Gast",
"features_registered": "Registriert",
"features_premium": "Premium",
"features_f_apps": "Zugang zu allen Anwendungen",
@ -510,7 +510,7 @@
"features_f_cryptdrive0_note": "Du kannst besuchte Dokumente in deinem Browser speichern, damit du sie später öffnen kannst",
"features_f_storage0": "Speicherung für eine begrenzte Zeit",
"features_f_storage0_note": "Dokumente werden nach {0} Tagen ohne Aktivität gelöscht",
"features_f_anon": "Alle Funktionen für anonyme Benutzer",
"features_f_anon": "Alle Funktionen für Gäste",
"features_f_anon_note": "Mit zusätzlichen Funktionen",
"features_f_cryptdrive1": "Alle Funktionen des CryptDrives",
"features_f_cryptdrive1_note": "Ordner, geteilte Ordner, Vorlagen, Tags",
@ -557,7 +557,7 @@
"creation_expireDays": "Tag(e)",
"creation_expireMonths": "Monat(e)",
"creation_password": "Passwort\n",
"creation_noTemplate": "Keine Vorlage",
"creation_noTemplate": "Leeres Dokument",
"creation_newTemplate": "Neue Vorlage",
"creation_create": "Erstellen",
"creation_owners": "Eigentümer",
@ -584,8 +584,8 @@
"share_linkView": "Ansehen",
"share_linkEmbed": "Einbettungsmodus (Werkzeugleiste und Benutzerliste verbergen)",
"share_linkPresent": "Anzeigemodus",
"share_linkOpen": "Vorschau",
"share_linkCopy": "Kopieren",
"share_linkOpen": "Link öffnen",
"share_linkCopy": "Link kopieren",
"share_embedCategory": "Einbetten",
"share_mediatagCopy": "Media-Tag in die Zwischenablage kopieren",
"sharedFolders_forget": "Dieses Pad ist nur in einem geteilten Ordner gespeichert. Du kannst es nicht in den Papierkorb verschieben. Aber du kannst es in deinem CryptDrive löschen.",
@ -882,7 +882,7 @@
"oo_exportInProgress": "Export wird durchgeführt",
"oo_sheetMigration_loading": "Deine Tabelle wird auf die neueste Version aktualisiert. Bitte warte etwa eine Minute.",
"oo_sheetMigration_complete": "Eine aktualisierte Version ist verfügbar. Klicke auf OK, um neu zu laden.",
"oo_sheetMigration_anonymousEditor": "Die Bearbeitung dieser Tabelle ist für nicht-registrierte Benutzer deaktiviert, bis sie von einem registrierten Benutzer auf die neueste Version aktualisiert wird.",
"oo_sheetMigration_anonymousEditor": "Die Bearbeitung dieser Tabelle ist für Gäste deaktiviert, bis sie von einem registrierten Benutzer auf die neueste Version aktualisiert wird.",
"imprint": "Impressum",
"isContact": "{0} ist einer deiner Kontakte",
"isNotContact": "{0} ist <b>nicht</b> einer deiner Kontakte",
@ -1120,7 +1120,7 @@
"whatis_apps": "Eine vollständige Anwendungs-Suite",
"whatis_drive_info": "<p>Speichere und verwalte Dokumente mit CryptDrive. Erstelle Ordner, gemeinsame Ordner und Tags, um Dokumente zu organisieren. Lade Dateien hoch und teile sie (PDFs, Fotos, Video, Audio, etc.). Team-Drives werden zwischen Benutzern geteilt und ermöglichen eine gemeinsame Organisation und detaillierte Zugriffskontrolle.</p>",
"whatis_apps_info": "<p>CryptPad bietet eine vollwertige Office-Suite mit allen notwendigen Werkzeugen für eine produktive Zusammenarbeit. Die Anwendungen umfassen: Rich Text, Tabellen, Code/Markdown, Kanban, Präsentationen, Whiteboard und Umfragen.</p><p>Die Anwendungen werden ergänzt durch eine Reihe von Funktionen zur Zusammenarbeit wie Chat, Kontakte, Farbe nach Autor (Code/Markdown) und Kommentare mit Erwähnungen (Rich Text).</p>",
"register_notes": "<ul class=\"cp-notes-list\"><li>Dein Passwort ist der geheime Schlüssel, der alle deine Dokumente verschlüsselt. <span class=\"red\">Wenn du ihn verlierst, gibt es keine Möglichkeit, deine Daten wiederherzustellen.</span></li><li>Wenn du einen gemeinsam genutzten Computer verwendest, <span class=\"red\">denke daran, dich abzumelden</span>, wenn du fertig bist. Durch bloßes Schließen des Browserfensters bleibt das Konto ungeschützt.</li><li>Um die erstellten und/oder gespeicherten Dokumente zu behalten, ohne eingeloggt zu sein, setze einen Haken bei \"Dokumente aus deiner nicht-registrierten Sitzung importieren\". </li></ul>",
"register_notes": "<ul class=\"cp-notes-list\"><li>Dein Passwort ist der geheime Schlüssel, der alle deine Dokumente verschlüsselt. <span class=\"red\">Wenn du ihn verlierst, gibt es keine Möglichkeit, deine Daten wiederherzustellen.</span></li><li>Wenn du einen gemeinsam genutzten Computer verwendest, <span class=\"red\">denke daran, dich abzumelden</span>, wenn du fertig bist. Durch bloßes Schließen des Browserfensters bleibt das Konto ungeschützt.</li><li>Um die Dokumente zu behalten, die du erstellt und/oder gespeichert hast, ohne eingeloggt zu sein, setze einen Haken bei \"Dokumente aus deiner Gast-Sitzung importieren\". </li></ul>",
"settings_cacheTitle": "Cache",
"settings_cacheButton": "Cache leeren",
"settings_cacheCheckbox": "Cache auf diesem Gerät aktivieren",
@ -1243,12 +1243,12 @@
"button_newform": "Neues Formular",
"form_page": "Seite {0}/{1}",
"form_anonymous_on": "Erlaubt",
"form_anonymous": "Anonyme Antworten",
"form_anonymous": "Gastzugriff (nicht eingeloggt)",
"form_removeEnd": "Enddatum entfernen",
"form_setEnd": "Enddatum festlegen",
"form_isPrivate": "Antworten sind privat",
"form_isPublic": "Antworten sind öffentlich",
"form_makePublicWarning": "Bist du sicher, dass du die Antworten veröffentlichen möchtest? Dies kann nicht rückgängig gemacht werden.",
"form_makePublicWarning": "Bist du sicher, dass du die Antworten veröffentlichen möchtest? Vergangene und zukünftige Antworten werden für Teilnehmer sichtbar sein. Dies kann nicht rückgängig gemacht werden.",
"form_makePublic": "Antworten veröffentlichen",
"form_invalidQuestion": "Frage {0}",
"form_input_ph_url": "https://example.com",
@ -1256,7 +1256,7 @@
"form_backButton": "Zurück",
"form_showSummary": "Zusammenfassung anzeigen",
"form_results_empty": "Es gibt keine Antworten",
"form_results": "Antworten",
"form_results": "Antworten ({0})",
"form_delete": "Löschen",
"form_reset": "Zurücksetzen",
"form_maxOptions": "Maximal {0} Antwort(en)",
@ -1382,5 +1382,19 @@
"fm_link_new": "Neuer Link",
"form_totalResponses": "Antworten insgesamt: {0}",
"ui_expand": "Ausklappen",
"ui_collapse": "Einklappen"
"ui_collapse": "Einklappen",
"support_premiumPriority": "Premium-Benutzer helfen bei der Verbesserung der Benutzerfreundlichkeit von CryptPad und profitieren von priorisierten Antworten auf ihre Support-Tickets.",
"support_premiumLink": "Abonnementoptionen ansehen",
"form_viewAnswer": "Meine Antworten anzeigen",
"form_editAnswer": "Meine Antworten bearbeiten",
"form_preview_button": "Vorschau",
"form_colors": "Farbschema",
"userlist_visitProfile": "Profil aufrufen",
"toolbar_preview": "Vorschau",
"form_geturl": "Link kopieren",
"upload_modal_alt": "Alt-Text",
"upload_addOptionalAlt": "Beschreibungstext hinzufügen (optional)",
"toolbar_expand": "Werkzeugleiste ausklappen",
"toolbar_collapse": "Werkzeugleiste einklappen",
"profile_defaultAlt": "Standard-Profilbild"
}

View File

@ -607,5 +607,44 @@
"share_linkEdit": "Editar",
"share_linkAccess": "Permisos de acceso",
"properties_passwordWarning": "La contraseña ha sido cambiada con éxito pero fue incapaz de actualizar tu CryptDrive con los nuevos datos. Es posible que tenga que eliminar la versión antigua del pad manualmente.<br>Pulse OK para recargar y actualizar sus derechos de acceso.",
"properties_passwordSuccess": "La contraseña ha sido cambiada con éxito.<br>Pulsa OK para recargar y actualizar tus derechos de acceso."
"properties_passwordSuccess": "La contraseña ha sido cambiada con éxito.<br>Pulsa OK para recargar y actualizar tus derechos de acceso.",
"admin_updateLimitTitle": "Actualizar cuotas de usuarios",
"admin_registeredHint": "Número de usuarios registrados en tu instancia",
"admin_registeredTitle": "Usuarios registrados",
"admin_activePadsHint": "Número de documentos únicos que se están viendo o editando ahora",
"admin_activePadsTitle": "Blocs activos",
"admin_activeSessionsHint": "Número de conexiones websocket activas (y direcciones IP únicas conectadas)",
"admin_activeSessionsTitle": "Conexiones activas",
"adminPage": "Administración",
"admin_cat_stats": "Estadísticas",
"admin_cat_general": "General",
"admin_authError": "Solo los administradores pueden acceder a esta página.",
"markdown_toc": "Contenido",
"survey": "Encuesta de CryptPad",
"crowdfunding_popup_no": "Ahora no",
"crowdfunding_popup_text": "<h3>¡Necesitamos tu ayuda!</h3>Para garantizar que CryptPad se desarrolle activamente, considera apoyar el proyecto a través de la página OpenCollective, donde puedes ver nuestra <b>Hoja de ruta</b> y <b>Objetivos de financiación</b>.",
"autostore_notAvailable": "Tienes que guardar el bloc en tu CryptDrive antes de usar esta función.",
"autostore_forceSave": "Guarda el fichero en tu CryptDrive",
"autostore_saved": "El bloc se guardó correctamente en tu CryptDrive!",
"autostore_error": "Error extraño: No pudimos guardar este bloc, inténtalo otra vez.",
"autostore_hide": "No guardar",
"autostore_store": "Guardar",
"autostore_settings": "Puedes habilitar el almacenamiento automático de blocs en su <a>Página de</a> configuración!",
"autostore_notstored": "Este {0} no está en su CryptDrive. ¿Quieres guardarlo ahora?",
"autostore_sf": "carpeta",
"chrome68": "Parece que estás usando el navegador Chrome o Chromium versión 68. Contiene un error que hace que la página se vuelva completamente blanca después de unos segundos o que la página no responda a los clics. Para solucionar este problema, puede cambiar a otra pestaña y volver, o tratar de desplazarse en la página. Este error debe corregirse en la próxima versión de su navegador.",
"convertFolderToSF_confirm": "Esta carpeta debe convertirse a carpeta compartida para que otros la puedan ver. ¿Continuar?",
"sharedFolders_create_owned": "Carpeta con propietario",
"sharedFolders_create_name": "Nombre de carpeta",
"share_embedCategory": "Embeber",
"share_linkPresent": "Presentar",
"share_linkEmbed": "Modo de inserción (oculta barra de herramientas y lista de usuarios)",
"settings_padOpenLinkLabel": "Habilita la apertura directa del enlace",
"settings_padOpenLinkHint": "Con esta opción puedes abrir enlaces embebidos haciendo click sin el popup de previsualización",
"properties_changePasswordButton": "Enviar",
"convertFolderToSF_SFChildren": "Esta carpeta no puede ser convertida a una carpeta compartida porque ya contiene carpetas compartidas. Mueva esas carpetas compartidas a otro lugar para continuar.",
"convertFolderToSF_SFParent": "Esta carpeta no puede ser convertida a una carpeta compartida en su actual localización. Mueva la carpeta fuera de la carperta compartida para continuar.",
"sharedFolders_share": "Comparte este enlace con otros usuarios registrados para darles accesso a la carpeta compartida. Una vez que ellos/as abran este enlace, la carpeta compartida será añadida a sus CryptDrive.",
"sharedFolders_create": "Crear una carpeta compartida",
"sharedFolders_duplicate": "Algunos de los documentos que intentaste mover ya estaban compartidos en la carpeta de destino"
}

View File

@ -26,7 +26,7 @@
"typeError": "Ce pad n'est pas compatible avec l'application sélectionnée",
"onLogout": "Vous êtes déconnecté de votre compte utilisateur, {0}cliquez ici{1} pour vous authentifier<br>ou appuyez sur <em>Échap</em> pour accéder au pad en mode lecture seule.",
"padNotPinned": "Ce pad va expirer après 3 mois d'inactivité, {0}connectez-vous{1} ou {2}enregistrez-vous{3} pour le préserver.",
"anonymousStoreDisabled": "L'administrateur de cette instance de CryptPad a désactivé le drive pour les utilisateurs non enregistrés. Vous devez vous connecter pour pouvoir utiliser CryptDrive.",
"anonymousStoreDisabled": "L'administrateur de cette instance de CryptPad a désactivé le drive pour les visiteurs. Enregistrez vous ou connectez vous à un compte pour pouvoir utiliser CryptDrive.",
"expiredError": "Ce pad a atteint sa date d'expiration est n'est donc plus disponible.",
"deletedError": "Ce document a été supprimé et n'est plus disponible.",
"inactiveError": "Ce pad a été supprimé en raison de son inactivité. Appuyez sur Échap pour créer un nouveau pad.",
@ -51,7 +51,7 @@
"forgotten": "Déplacé vers la corbeille",
"errorState": "Erreur critique : {0}",
"readonly": "Lecture seule",
"anonymous": "Anonyme",
"anonymous": "Visiteur",
"users": "Utilisateurs",
"viewer": "lecteur",
"viewers": "lecteurs",
@ -89,7 +89,7 @@
"shareSuccess": "Lien copié dans le presse-papiers",
"userListButton": "Liste d'utilisateurs",
"chatButton": "Chat",
"userAccountButton": "Votre compte",
"userAccountButton": "Menu utilisateur",
"newButton": "Nouveau",
"newButtonTitle": "Créer un nouveau pad",
"uploadButton": "Importer des fichiers",
@ -333,7 +333,7 @@
"login_invalUser": "Nom d'utilisateur requis",
"login_invalPass": "Mot de passe requis",
"login_unhandledError": "Une erreur inattendue s'est produite :(",
"register_importRecent": "Importer les documents de votre session non-enregistrée",
"register_importRecent": "Importer les documents de votre session visiteur",
"register_acceptTerms": "J'accepte <a>les conditions d'utilisation</a>",
"register_passwordsDontMatch": "Les mots de passe doivent être identiques !",
"register_passwordTooShort": "Les mots de passe doivent contenir au moins {0} caractères.",
@ -502,7 +502,7 @@
"whatis_drive": "Organisation avec CryptDrive",
"features": "Fonctionnalités",
"features_title": "Fonctionnalités",
"features_anon": "Non-enregistré",
"features_anon": "Visiteur",
"features_registered": "Enregistré",
"features_premium": "Premium",
"features_f_apps": "Accès à toutes les applications",
@ -514,7 +514,7 @@
"features_f_cryptdrive0_note": "Stockage dans votre navigateur des pads visités afin de pouvoir les retrouver plus tard",
"features_f_storage0": "Durée de stockage limitée",
"features_f_storage0_note": "Les documents sont supprimés après {0} jours d'inactivité",
"features_f_anon": "Avantages des utilisateurs anonymes",
"features_f_anon": "Avantages des visiteurs",
"features_f_anon_note": "Avec des fonctionnalités supplémentaires",
"features_f_cryptdrive1": "Accès complet à CryptDrive",
"features_f_cryptdrive1_note": "Dossiers, dossiers partagés, modèles, tags",
@ -561,7 +561,7 @@
"creation_expireDays": "Jour(s)",
"creation_expireMonths": "Mois",
"creation_password": "Mot de passe\n",
"creation_noTemplate": "Pas de modèle",
"creation_noTemplate": "Document vierge",
"creation_newTemplate": "Nouveau modèle",
"creation_create": "Créer",
"creation_owners": "Propriétaires",
@ -588,8 +588,8 @@
"share_linkView": "Lecture-seule",
"share_linkEmbed": "Mode intégration (cache la barre d'outils)",
"share_linkPresent": "Présenter",
"share_linkOpen": "Aperçu",
"share_linkCopy": "Copier",
"share_linkOpen": "Ouvrir le lien",
"share_linkCopy": "Copier le lien",
"share_embedCategory": "Intégration",
"share_mediatagCopy": "Copier le mediatag",
"sharedFolders_forget": "Ce pad est stocké uniquement dans un dossier partagé. Vous ne pouvez pas le déplacer dans votre corbeille. Si vous souhaitez le supprimer, vous pouvez utiliser l'application CryptDrive.",
@ -879,7 +879,7 @@
"oo_exportInProgress": "Exportation en cours",
"oo_sheetMigration_loading": "Mise à jour de la feuille de calcul. Merci de patienter environ 1 minute.",
"oo_sheetMigration_complete": "Version mise à jour disponible, appuyez sur OK pour recharger.",
"oo_sheetMigration_anonymousEditor": "L'édition de cette feuille de calcul est désactivée pour les utilisateurs non-enregistrés jusqu'à ce qu'elle soit mise à jour par un utilisateur enregistré.",
"oo_sheetMigration_anonymousEditor": "L'édition de cette feuille de calcul est désactivée pour les visiteurs jusqu'à ce qu'elle soit mise à jour par un utilisateur enregistré.",
"imprint": "Mentions légales",
"isContact": "{0} est dans vos contacts",
"isNotContact": "{0} n'est <b>pas</b> dans vos contacts",
@ -1108,7 +1108,7 @@
"whatis_apps": "Une suite complète d'applications",
"whatis_collaboration_info": "<p>CryptPad est construit pour permettre la collaboration. Les modifications apportées aux documents sont synchronisées en temps réel. Comme toutes les données sont chiffrées, le service et ses administrateurs n'ont aucun moyen de voir le contenu en cours d'édition et de stockage.</p>",
"register_warning_note": "En raison de la nature chiffrée de CryptPad, les administrateurs du service ne seront pas en mesure de récupérer les données au cas où vous oublieriez votre nom d'utilisateur et/ou votre mot de passe. Veuillez les sauvegarder dans un endroit sûr.",
"register_notes": "<ul class=\"cp-notes-list\"><li>Votre mot de passe est la clé secrète utilisée pour chiffrer tous vos documents. <span class=\"red\">Si vous le perdez, nous ne pourrons pas récupérer vos données.</span></li><li>Si vous utilisez un ordinateur partagé, <span class=\"red\">n'oubliez pas de vous déconnecter</span> après avoir terminé. La simple fermeture de la fenêtre du navigateur laisse votre compte exposé.</li><li>Pour conserver les documents que vous avez créés et/ou stockés sans être connecté, cochez \"Importer les documents de votre session anonyme\". </li></ul>",
"register_notes": "<ul class=\"cp-notes-list\"><li>Votre mot de passe est la clé secrète utilisée pour chiffrer tous vos documents. <span class=\"red\">Si vous le perdez, nous ne pourrons pas récupérer vos données.</span></li><li>Si vous utilisez un ordinateur partagé, <span class=\"red\">n'oubliez pas de vous déconnecter</span> après avoir terminé. La simple fermeture de la fenêtre du navigateur laisse votre compte exposé.</li><li>Pour conserver les documents que vous avez créés et/ou stockés sans être connecté, cochez \"Importer les documents de votre session visiteur\". </li></ul>",
"register_notes_title": "Notes importantes",
"home_support": "<p>L'équipe de développement ne tire aucun profit des données personnelles des utilisateurs. Cela s'inscrit dans une vision pour des services en ligne qui respectent la vie privée. Contrairement aux grandes plateformes qui prétendent être \"gratuites\" tout en tirant profit des informations personnelles, CryptPad vise à construire un modèle durable financé volontairement par les utilisateurs.</p><p>Vous pouvez soutenir le projet en faisant un don unique ou récurrent par le biais de notre Open Collective. Notre budget est transparent et des mises à jour sont publiées régulièrement. Il existe également un certain nombre de <a>moyens non financiers de contribuer</a>.</p>",
"home_support_title": "Soutenez CryptPad",
@ -1230,7 +1230,7 @@
"genericCopySuccess": "Copié dans le presse-papiers",
"mediatag_defaultImageName": "image",
"register_registrationIsClosed": "Les inscriptions sont fermées.",
"oo_conversionSupport": "Votre navigateur ne gère pas la conversion vers et depuis les formats Microsoft Office. Il est recommandé d'utiliser une version récente de Firefox ou Chrome.",
"oo_conversionSupport": "Votre navigateur ne gère pas la conversion vers et depuis les formats office. Il est recommandé d'utiliser une version récente de Firefox ou Chrome.",
"oo_importBin": "Cliquez sur OK pour importer au format .bin interne à CryptPad.",
"admin_emailButton": "Valider",
"admin_supportPrivButton": "Afficher la clé",
@ -1274,7 +1274,7 @@
"form_clear": "Effacer",
"form_addMultipleHint": "Ajouter plusieurs dates et heures",
"form_addMultiple": "Tout ajouter",
"form_anonymous_blocked": "Les réponses anonymes sont bloquées pour ce formulaire. Merci de vous <a href=\"/login/\">connecter</a> ou de vous <a href=\"/register/\">enregistrer</a> pour répondre.",
"form_anonymous_blocked": "Les réponses de visiteurs sont bloquées pour ce formulaire. Merci de vous <a href=\"/login/\">connecter</a> ou de vous <a href=\"/register/\">enregistrer</a> pour répondre.",
"form_add_item": "Ajouter un objet",
"form_add_option": "Ajouter une option",
"form_newItem": "Nouvel objet",
@ -1283,7 +1283,7 @@
"form_defaultOption": "Option {0}",
"form_anonymous_off": "Bloquées",
"form_anonymous_on": "Autorisées",
"form_anonymous": "Réponses anonymes",
"form_anonymous": "Accès visiteur (non connecté)",
"form_willClose": "Ce formulaire fermera le {0}",
"form_isClosed": "Ce formulaire a été fermé le {0}",
"form_isOpen": "Ce formulaire est ouvert",
@ -1292,7 +1292,7 @@
"form_open": "Ouvrir",
"form_isPrivate": "Les réponses sont privées",
"form_isPublic": "Les réponses sont publiques",
"form_makePublicWarning": "Êtes-vous sûr de vouloir rendre les réponses à ce formulaire publiques ? Cette opération ne peut pas être annulée.",
"form_makePublicWarning": "Êtes-vous sûr de vouloir rendre publiques les réponses à ce formulaire ? Les réponses passées et futures seront visibles par les participants. Cette opération ne peut pas être annulée.",
"form_makePublic": "Publier les réponses",
"form_invalidQuestion": "Questions {0}",
"form_invalidWarning": "Certaines résponses contiennent des erreurs :",
@ -1309,7 +1309,7 @@
"form_form": "Formulaire",
"form_editor": "Éditeur",
"form_results_empty": "Il n'y a pas de réponses",
"form_results": "Réponses",
"form_results": "Réponses ({0})",
"form_answered": "Vous avez déjà répondu à ce formulaire",
"form_cantFindAnswers": "Vos réponses à ce formulaire n'ont pas pu être récupérées.",
"form_updateWarning": "Mettre à jour avec erreurs",
@ -1381,5 +1381,48 @@
"fm_link_new": "Nouveau Lien",
"notification_openLink": "Vous avez reçu un lien <b>{0}</b> de {1} :",
"ui_expand": "Développer",
"ui_collapse": "Réduire"
"ui_collapse": "Réduire",
"form_totalResponses": "Nombre de réponses : {0}",
"form_colors": "Thème de couleur",
"userlist_visitProfile": "Voir le profil",
"form_conditional_addAnd": "Ajouter une condition et",
"form_conditional_add": "Ajouter une condition ou",
"form_conditional": "Cette section ne sera affichée que si :",
"form_condition_has": "contient",
"form_condition_hasnot": "ne contient pas",
"form_condition_is": "est",
"form_condition_isnot": "n'est pas",
"form_condition_v": "Choisir une réponse",
"form_condition_q": "Choisir une question",
"form_type_section": "Section conditionelle",
"form_editable": "Modifier les réponses après l'envoi",
"form_responseMsg": "Ce message s'affichera après l'envoi du formulaire par un participant.",
"form_makeAnon": "Anonymiser les résponses",
"form_corruptAnswers": "Ce formulaire a déjà reçu des réponses. La modification du type de question risque d'invalider les données des réponses précédentes.",
"form_geturl": "Copier le lien",
"toolbar_preview": "Aperçu",
"form_updateMsg": "Modifier le message de confirmation",
"form_addMsg": "Ajouter un message de confirmation",
"form_changeTypeConfirm": "Sélectionner le type de question.",
"form_preview": "Aperçu",
"form_required_off": "Optionelle",
"form_required_on": "Requise",
"form_required_answer": "Réponse : ",
"form_requiredWarning": "Une réponse est requise pour les questions suivantes :",
"form_authAnswer": "Ce formulaire ne peut pas être envoyé de manière anonyme",
"form_anonAnswer": "Les réponses à ce formulaire sont anonymisées",
"form_viewAllAnswers": "Voir toutes les réponses ({0})",
"form_viewAnswer": "Voir mes réponses",
"form_editAnswer": "Modifier mes réponses",
"form_alreadyAnswered": "Vous avez repondu à ce formulaire le {0}",
"form_preview_button": "Aperçu",
"form_template_poll": "Sondage de disponibilité",
"upload_addOptionalAlt": "Ajouter un texte descitpif (optionnel)",
"upload_modal_alt": "Texte alternatif",
"profile_defaultAlt": "Image de profil par défaut",
"toolbar_expand": "Afficher la barre d'outils",
"toolbar_collapse": "Cacher la barre d'outils",
"support_premiumLink": "Voir les options d'abonnement",
"support_premiumPriority": "Les utilisateurs abonnés contribuent à l'amélioration des fonctionnalités de CryptPad et bénéficient de réponses prioritaires à leurs tickets de support.",
"form_conditional_hint": "Pour rendre cette section conditionnelle, veuillez ajouter une question choix ou cases à cocher ci-dessus"
}

View File

@ -123,7 +123,7 @@
"login_hashing": "パスワードをハッシュ化しています。この処理には時間がかかる場合があります。",
"login_invalPass": "パスワードを入力してください",
"login_invalUser": "ユーザー名を入力してください",
"register_importRecent": "匿名セッションのドキュメントをインポート",
"register_importRecent": "ゲストセッションのドキュメントをインポート",
"importButton": "インポート",
"main_catch_phrase": "コラボレーションスイート<br>端末間暗号化とオープンソース",
"tos_3rdparties": "私たちは、法令に基づく場合を除き、個人情報を第三者に提供しません。",
@ -196,7 +196,7 @@
"contacts_unmute": "ミュート解除",
"contacts_mute": "ミュート",
"contacts": "連絡先",
"share_linkOpen": "プレビュー",
"share_linkOpen": "リンクを開く",
"share_linkView": "表示",
"view": "表示",
"settings_exportError": "表示エラー",
@ -206,7 +206,7 @@
"reconnecting": "再接続中",
"synchronizing": "同期中",
"initializing": "初期化中...",
"anonymous": "匿名",
"anonymous": "ゲスト",
"editor": "編集者",
"typing": "編集中",
"team_infoLabel": "チームについて",
@ -265,7 +265,7 @@
"features_f_cryptdrive1_note": "フォルダ、共有フォルダ、テンプレート、タグ",
"features_f_cryptdrive1": "CryptDriveの全機能",
"features_f_anon_note": "追加機能あり",
"features_f_anon": "匿名ユーザーの全機能",
"features_f_anon": "ゲストユーザーの全機能",
"features_f_storage0_note": "ドキュメントは{0}日以上利用されないと削除されます",
"features_f_storage0": "一時的な保存",
"features_f_cryptdrive0_note": "アクセスしたパッドをブラウザに保存して、後で開くことができます",
@ -278,7 +278,7 @@
"features_premium": "プレミアム",
"features_registered": "登録済",
"features_title": "機能",
"features_anon": "未登録",
"features_anon": "ゲスト",
"register_whyRegister": "登録するメリットをご紹介します",
"historyText": "履歴",
"help_button": "ヘルプ",
@ -481,7 +481,7 @@
"upload_pending": "保留中",
"settings_resetTips": "ヒント",
"chrome68": "バージョン68のChromeもしくはChromiumを使用しているようです。このバージョンには、数秒経過した後でページが白紙になったり、クリックにページが反応しなくなったりするバグがあります。この問題を解決するには、別のタブを表示して改めて表示するか、このページでスクロールを試みてください。このバグは次のバージョンで解決される予定となっています。",
"register_notes": "<ul class=\"cp-notes-list\"><li>ドキュメントは、パスワードによって暗号化されます。<span class=\"red\">パスワードを紛失すると、データを復元することはできません。</span></li><li>共有のコンピュータを使用している場合は、作業完了時に<span class=\"red\">忘れずログアウトしてください。</span> ブラウザーのウインドウを閉じても、アカウントからはログアウトされません。</li><li>未ログインで作成、共有したファイルを保存するには、 「匿名セッションのドキュメントをインポート」にチェックをしてください。 </li></ul>",
"register_notes": "<ul class=\"cp-notes-list\"><li>ドキュメントは、パスワードによって暗号化されます。<span class=\"red\">パスワードを紛失すると、データを復元することはできません。</span></li><li>共有のコンピュータを使用している場合は、作業完了時に<span class=\"red\">忘れずログアウトしてください。</span> ブラウザーのウインドウを閉じても、アカウントからはログアウトされません。</li><li>未ログインで作成、共有したファイルを保存するには、 「ゲストセッションのドキュメントをインポート」にチェックをしてください。 </li></ul>",
"poll_commit": "送信",
"admin_removeDonateButtonTitle": "クラウドファンディングへの参加",
"mediatag_notReady": "ダウンロードを完了してください",
@ -525,7 +525,7 @@
"crowdfunding_popup_no": "あとで",
"sharedFolders_create_name": "フォルダ名",
"creation_newTemplate": "新しいテンプレート",
"creation_noTemplate": "テンプレートがありません",
"creation_noTemplate": "空のドキュメント",
"creation_expire": "期限切れのパッド",
"mdToolbar_list": "箇条書き",
"uploadFolder_modal_filesPassword": "ファイルのパスワード",
@ -626,7 +626,7 @@
"autostore_pad": "パッド",
"autostore_sf": "フォルダ",
"autostore_file": "ファイル",
"share_linkCopy": "コピー",
"share_linkCopy": "リンクをコピー",
"creation_passwordValue": "パスワード",
"edit": "編集",
"features": "機能",
@ -746,7 +746,7 @@
"saveTemplatePrompt": "テンプレートのタイトルを入力してください",
"newButtonTitle": "新しいパッドを作成",
"newButton": "新規",
"userAccountButton": "アカウント",
"userAccountButton": "メニュー",
"userListButton": "ユーザーリスト",
"movedToTrash": "パッドをゴミ箱に移動しました。<br><a>ドライブにアクセス</a>",
"forgetPrompt": "OKをクリックするとパッドをゴミ箱へと移動します。よろしいですか",
@ -774,7 +774,7 @@
"inactiveError": "このパッドは利用されていなかったため削除されました。Escキーを押すと新しいパッドを作成します。",
"deletedError": "このドキュメントは削除されたため、利用できなくなりました。",
"expiredError": "このパッドは利用期限を過ぎてしまったため、利用できなくなりました。",
"anonymousStoreDisabled": "このCryptPadのインスタンスの管理者は、匿名ユーザーによる保存を無効に設定しています。CryptDriveを使用するにはログインする必要があります。",
"anonymousStoreDisabled": "このCryptPadのインスタンスの管理者は、ゲストによる保存を無効に設定しています。あなたのCryptDriveにアクセスするにはログインが必要です。",
"padNotPinnedVariable": "このパッドは{4}日間利用しないと有効期限が切れます。{0}ログイン{1}するか{2}登録{3}して保存してください。",
"padNotPinned": "このパッドは3か月間利用しないと有効期限が切れます。{0}ログイン{1}するか{2}登録{3}して保存してください。",
"onLogout": "ログアウトしました。{0}ここをクリック{1}するか<br><em>Escape</em>キーを押すと、閲覧モードでパッドにアクセスできます。",
@ -905,7 +905,7 @@
"form_showSummary": "概要を表示",
"form_showIndividual": "個々の回答を表示",
"form_results_empty": "回答がありません",
"form_results": "回答",
"form_results": "回答{0}",
"form_answered": "このフォームは回答済みです",
"form_cantFindAnswers": "このフォームの既存の回答を取得できません。",
"form_duplicates": "重複する項目が削除されました",
@ -1095,7 +1095,7 @@
"trimHistory_getSizeError": "ドライブの履歴のサイズを計算している途中でエラーが発生しました",
"profile_login": "このユーザーを連絡先に追加するにはログインする必要があります",
"dontShowAgain": "再び表示しない",
"oo_sheetMigration_anonymousEditor": "登録ユーザーが最新のバージョンに更新するまで、このスプレッドシートを未登録ユーザーが編集することはできません。",
"oo_sheetMigration_anonymousEditor": "登録ユーザーが最新のバージョンに更新するまで、このスプレッドシートをゲストが編集することはできません。",
"oo_invalidFormat": "このファイルはインポートできません",
"burnAfterReading_warningDeleted": "このパッドは削除されました。ウインドウを閉じた後で再びアクセスすることはできません。",
"burnAfterReading_proceed": "表示して削除",
@ -1382,5 +1382,35 @@
"form_answerAs": "名前を記入してください",
"form_totalResponses": "回答数:{0}",
"ui_expand": "広げる",
"ui_collapse": "折りたたむ"
"ui_collapse": "折りたたむ",
"support_premiumPriority": "プレミアムユーザーになると、CryptPadの使い勝手を改良する手助けができるほか、サポートチケットに対する優先サポートを受けることができます。",
"support_premiumLink": "定額利用のオプションを表示",
"toolbar_collapse": "ツールバーをたたむ",
"toolbar_expand": "ツールバーを広げる",
"form_preview": "フォームをプレビュー",
"form_geturl": "リンクをコピー",
"form_viewAnswer": "回答を表示",
"form_editAnswer": "回答を編集",
"form_preview_button": "プレビュー",
"upload_addOptionalAlt": "説明文を追加(任意)",
"upload_modal_alt": "代替テキスト",
"form_authAnswer": "このフォームは匿名では送信できません",
"form_anonAnswer": "このフォームへの回答は匿名化されています",
"form_viewAllAnswers": "全ての回答を表示({0}",
"form_condition_v": "値を選択",
"form_condition_q": "質問を選択",
"form_makeAnon": "回答を匿名化",
"toolbar_preview": "プレビュー",
"form_required_off": "任意",
"form_required_on": "必須",
"form_colors": "テーマの色",
"profile_defaultAlt": "既定のプロフィール画像",
"userlist_visitProfile": "プロフィールを表示",
"form_addMsg": "送信時のメッセージを追加",
"form_updateMsg": "送信時のメッセージを変更",
"form_corruptAnswers": "このフォームには既に回答があります。設問の種類を変更すると、回答のデータが無効になる恐れがあります。",
"form_changeTypeConfirm": "新しい設問の種類を選択してください。",
"form_required_answer": "回答: ",
"form_requiredWarning": "以下の設問は回答が必須です:",
"form_alreadyAnswered": "このフォームに{0}に回答しました"
}

View File

@ -28,7 +28,7 @@
"onLogout": "You are logged out, {0}click here{1} to log in<br>or press <em>Escape</em> to access your pad in read-only mode.",
"padNotPinned": "This pad will expire after 3 months of inactivity, {0}login{1} or {2}register{3} to preserve it.",
"padNotPinnedVariable": "This pad will expire after {4} days of inactivity, {0}login{1} or {2}register{3} to preserve it.",
"anonymousStoreDisabled": "The webmaster of this CryptPad instance has disabled the store for anonymous users. You have to log in to be able to use CryptDrive.",
"anonymousStoreDisabled": "The administrator of this CryptPad instance has disabled storage for guests. Log in to access your own CryptDrive.",
"expiredError": "This pad has reached its expiration time and is no longer available.",
"deletedError": "This document has been deleted and is no longer available.",
"inactiveError": "This pad has been deleted due to inactivity. Press Esc to create a new pad.",
@ -53,7 +53,7 @@
"forgotten": "Moved to the trash",
"errorState": "Critical error: {0}",
"readonly": "Read only",
"anonymous": "Anonymous",
"anonymous": "Guest",
"users": "Users",
"viewer": "viewer",
"viewers": "viewers",
@ -92,7 +92,7 @@
"shareSuccess": "Copied link to clipboard",
"userListButton": "User list",
"chatButton": "Chat",
"userAccountButton": "Your account",
"userAccountButton": "User menu",
"newButton": "New",
"newButtonTitle": "Create a new pad",
"uploadButton": "Upload files",
@ -339,7 +339,7 @@
"login_invalUser": "Username required",
"login_invalPass": "Password required",
"login_unhandledError": "An unexpected error occurred :(",
"register_importRecent": "Import documents from your unregistered session",
"register_importRecent": "Import documents from your guest session",
"register_acceptTerms": "I accept <a>the terms of service</a>",
"register_passwordsDontMatch": "Passwords do not match!",
"register_passwordTooShort": "Passwords must be at least {0} characters long.",
@ -520,7 +520,7 @@
"whatis_drive": "Organization with CryptDrive",
"features": "Features",
"features_title": "Features",
"features_anon": "Non-registered",
"features_anon": "Guest",
"features_registered": "Registered",
"features_premium": "Premium",
"features_f_apps": "Access to all the applications",
@ -532,7 +532,7 @@
"features_f_cryptdrive0_note": "Ability to store visited pads in your browser to be able to open them later",
"features_f_storage0": "Limited storage time",
"features_f_storage0_note": "Documents are deleted after {0} days of inactivity",
"features_f_anon": "All anonymous user features",
"features_f_anon": "All guest user features",
"features_f_anon_note": "With additional functionality",
"features_f_cryptdrive1": "Complete CryptDrive functionality",
"features_f_cryptdrive1_note": "Folders, shared folders, templates, tags",
@ -579,7 +579,7 @@
"creation_expireDays": "Day(s)",
"creation_expireMonths": "Month(s)",
"creation_password": "Password\n",
"creation_noTemplate": "No template",
"creation_noTemplate": "Blank document",
"creation_newTemplate": "New template",
"creation_create": "Create",
"creation_owners": "Owners",
@ -606,8 +606,8 @@
"share_linkView": "View",
"share_linkEmbed": "Embed mode (hide toolbar and user list)",
"share_linkPresent": "Present",
"share_linkOpen": "Preview",
"share_linkCopy": "Copy",
"share_linkOpen": "Open link",
"share_linkCopy": "Copy link",
"share_contactCategory": "Contacts",
"share_embedCategory": "Embed",
"share_mediatagCopy": "Copy mediatag to clipboard",
@ -884,7 +884,7 @@
"oo_exportInProgress": "Export in progress",
"oo_sheetMigration_loading": "Upgrading your spreadsheet to the latest version. Please wait approximately 1 minute.",
"oo_sheetMigration_complete": "Updated version available, press OK to reload.",
"oo_sheetMigration_anonymousEditor": "Editing this spreadsheet is disabled for non-registered users until it is upgraded to the latest version by a registered user.",
"oo_sheetMigration_anonymousEditor": "Editing this spreadsheet is disabled for guests until it is upgraded to the latest version by a registered user.",
"imprint": "Legal notice",
"settings_cat_security": "Confidentiality",
"settings_safeLinksTitle": "Safe Links",
@ -1108,7 +1108,7 @@
"home_support_title": "Support CryptPad",
"home_support": "<p>The development team does not profit from user data in any way. This is part of a vision for online services that respect privacy. Unlike the big platforms that pretend to be \"free\" while making profits from personal information, we aim to build a sustainable model funded willingly by users.</p><p>You can support the project by making a one-time or recurring donation through our Open Collective. Our budget is transparent and updates are published regularly. There are also a number of <a>non-financial ways to contribute</a>.</p>",
"register_notes_title": "Important notes",
"register_notes": "<ul class=\"cp-notes-list\"><li>Your password is the secret key that encrypts all of your documents. <span class=\"red\">If you lose it there is no way we can recover your data.</span></li><li>If you are using a shared computer, <span class=\"red\">remember to log out</span> when you are done. Only closing the browser window leaves your account exposed. </li><li>To keep the documents you created and/or stored without being logged in, tick \"Import documents from your anonymous session\". </li></ul>",
"register_notes": "<ul class=\"cp-notes-list\"><li>Your password is the secret key that encrypts all of your documents. <span class=\"red\">If you lose it there is no way we can recover your data.</span></li><li>If you are using a shared computer, <span class=\"red\">remember to log out</span> when you are done. Only closing the browser window leaves your account exposed. </li><li>To keep the documents you created and/or stored without being logged in, tick \"Import documents from your guest session\". </li></ul>",
"register_warning_note": "Due to the encrypted nature of CryptPad, the service administrators will not be able to recover data in case you forget your username and/or password. Please save them in a safe place.",
"whatis_collaboration_info": "<p>CryptPad is built to enable collaboration. It synchronizes changes to documents in real time. Because all data is encrypted, the service and its administrators have no way of seeing the content being edited and stored.</p>",
"whatis_apps": "A full suite of applications",
@ -1284,7 +1284,7 @@
"form_updateWarning": "Update anyway",
"form_cantFindAnswers": "Unable to retrieve your existing answers for this form.",
"form_answered": "You have already answered this form",
"form_results": "Responses",
"form_results": "Responses ({0})",
"form_results_empty": "There are no responses",
"form_editor": "Editor",
"form_form": "Form",
@ -1301,7 +1301,7 @@
"form_invalidWarning": "There are errors in some answers:",
"form_invalidQuestion": "Question {0}",
"form_makePublic": "Publish responses",
"form_makePublicWarning": "Are you sure you want to make responses to this form public? This cannot be undone.",
"form_makePublicWarning": "Are you sure you want to make responses to this form public? Past and future responses will be visible by participants. This cannot be undone.",
"form_isPublic": "Responses are public",
"form_isPrivate": "Responses are private",
"form_open": "Open",
@ -1310,7 +1310,7 @@
"form_isOpen": "This form is open",
"form_isClosed": "This form was closed on {0}",
"form_willClose": "This form will close on {0}",
"form_anonymous": "Anonymous answers",
"form_anonymous": "Guest access (not logged in)",
"form_anonymous_on": "Allowed",
"form_anonymous_off": "Blocked",
"form_defaultOption": "Option {0}",
@ -1319,7 +1319,7 @@
"form_newItem": "New item",
"form_add_option": "Add option",
"form_add_item": "Add item",
"form_anonymous_blocked": "Anonymous responses are blocked for this form. You must <a href=\"/login/\">log in</a> or <a href=\"/register/\">register</a> to submit answers.",
"form_anonymous_blocked": "Guest responses are blocked for this form. You must <a href=\"/login/\">log in</a> or <a href=\"/register/\">register</a> to submit answers.",
"form_addMultiple": "Add all",
"form_addMultipleHint": "Add multiple dates and times",
"form_clear": "Clear",
@ -1382,5 +1382,47 @@
"fm_link_invalid": "Invalid URL",
"ui_collapse": "Collapse",
"ui_expand": "Expand",
"form_totalResponses": "Total responses: {0}"
"form_totalResponses": "Total responses: {0}",
"support_premiumPriority": "Premium users help support improvements to CryptPad's usability and benefit from prioritized responses to their support tickets.",
"support_premiumLink": "View subscription options",
"toolbar_collapse": "Collapse toolbar",
"toolbar_expand": "Expand toolbar",
"profile_defaultAlt": "Default profile picture",
"upload_modal_alt": "Alt text",
"upload_addOptionalAlt": "Add descriptive text (optional)",
"form_template_poll": "Quick Scheduling Poll",
"form_preview_button": "Preview",
"form_alreadyAnswered": "You responded to this form on {0}",
"form_editAnswer": "Edit my responses",
"form_viewAnswer": "View my responses",
"form_viewAllAnswers": "View all responses ({0})",
"form_anonAnswer": "Responses to this form are anonymized",
"form_authAnswer": "This form cannot be submitted anonymously",
"form_requiredWarning": "The following questions require an answer:",
"form_required_answer": "Answer: ",
"form_required_on": "Required",
"form_required_off": "Optional",
"form_preview": "Preview form",
"form_changeTypeConfirm": "Select the new question type.",
"form_corruptAnswers": "This form already has responses. Changing this question type may invalidate previous response data.",
"form_geturl": "Copy link",
"toolbar_preview": "Preview",
"form_updateMsg": "Update submit message",
"form_addMsg": "Add submit message",
"form_responseMsg": "This message will be displayed after participants submit the form.",
"form_makeAnon": "Anonymize responses",
"form_editable": "Editing after submission",
"form_type_section": "Conditional section",
"form_condition_q": "Choose a question",
"form_condition_v": "Choose a value",
"form_condition_is": "is",
"form_condition_isnot": "is not",
"form_condition_has": "has",
"form_condition_hasnot": "has not",
"form_conditional": "Only show this section when:",
"form_conditional_add": "Add OR condition",
"form_conditional_addAnd": "Add AND condition",
"userlist_visitProfile": "Visit profile",
"form_colors": "Color theme",
"form_conditional_hint": "To make this section conditional, please add a choice or checkbox question above it"
}

View File

@ -13,7 +13,8 @@
"todo": "Список дел",
"contacts": "Адресная книга",
"sheet": "Таблица",
"teams": "Команды"
"teams": "Команды",
"form": "Формы"
},
"button_newpad": "Новая документ с форматированием",
"button_newcode": "Новый документ с кодом",
@ -31,13 +32,13 @@
"inactiveError": "Этот документ был удалён из-за длительной неактивности. Нажмите Esc чтобы создать новый.",
"chainpadError": "Во время обновления вашей информации произошла критическая ошибка. Документ пока доступен только для чтения чтобы вы не потеряли свою информацию. <br>Нажмите <em>Esc</em> чтобы продолжать чтение или перезагрузите страницу и начните заново.",
"invalidHashError": "Запрошенный вами документ имеет неправильный адрес URL.",
"errorCopy": " Вы можете только скопировать содержимое в другое место, нажав <em>Esc</em>.<br>Если вы закроете страницу, всё содержимое будет утеряно!",
"errorCopy": "Вы все еще можете получить доступ к содержимому, нажав <em>Esc</em>.<br>Если вы закроете это окно, содержимое будет утеряно.",
"errorRedirectToHome": "Нажмите <em>Esc</em> чтобы перейти к вашему хранилищу.",
"newVersionError": "Доступна новая версия CryptPad.<br><a href='#'>Перезагрузите</a> чтобы использовать новую версию или нажмите Esc, чтобы использовать вашу информацию в <b>оффлайн-режиме</b>.",
"loading": "Загрузка...",
"error": "Ошибка",
"saved": "Сохранено",
"deleted": "Документ удалён из вашего CryptDrive",
"deleted": "Удалено",
"deletedFromServer": "Документ удалён с сервера",
"mustLogin": "Вам нужно войти, чтобы получить доступ к этой странице",
"disabledApp": "Приложение было отключено. Свяжитесь с администратором этого CryptPad.",
@ -91,7 +92,7 @@
"userAccountButton": "Ваш профиль",
"newButton": "Создать",
"uploadButton": "Загрузить файлы",
"uploadButtonTitle": "Загрузить новый файл в эту папку",
"uploadButtonTitle": "Загрузить новый файл в ваш CryptDrive",
"saveTemplateButton": "Сохранить как образец",
"saveTemplatePrompt": "Выбрать название для образца",
"templateSaved": "Образец сохранен!",
@ -120,7 +121,7 @@
"filePicker_description": "Выберите файл из вашего CryptDrive чтобы вставить его или выберите новый",
"filePicker_filter": "Филтровать файлы по именам",
"tags_title": "Теги (только для вас)",
"tags_add": "Обновить теги страницы",
"tags_add": "Обновить теги выбранных документов",
"tags_notShared": "Ваши теги не разделяются с другими пользователями",
"button_newsheet": "Новый Лист",
"newButtonTitle": "создать новую запись",

View File

@ -85,8 +85,8 @@ define([
},
};
Messages.convertPage = "Convert"; // XXX 4.10.0
Messages.convert_hint = "Pick the file you want to convert. The list of output format will be visible afterward."; // XXX 4.10.0
Messages.convertPage = "Convert"; // XXX 4.11.0
Messages.convert_hint = "Pick the file you want to convert. The list of output format will be visible afterward."; // XXX 4.11.0
var createToolbar = function () {
var displayed = ['useradmin', 'newpad', 'limit', 'pageTitle', 'notifications'];

View File

@ -62,7 +62,6 @@ define([
}
var configTb = {
displayed: displayed,
//hideDisplayName: true,
$container: $bar,
metadataMgr: metadataMgr,
sfCommon: common,

View File

@ -10,12 +10,88 @@
@bg-color: @colortheme_apps[form]
);
@cp_form_bar_color: fade(@cryptpad_color_link, 75%); // Color for the response chart bars
display: flex;
flex-flow: column;
font: @colortheme_app-font;
color: @cryptpad_text_col;
background-color: @cp_app-bg;
.alert {
font-size: 1rem;
&.alert-info {
color: @cryptpad_text_col !important;
}
}
@palette0: @cp_kanban-color0; // Default bg color for header
@form-colors: @cp_form-palette;
.form-colors(@form-colors; @index) when (@index > 0){
.form-colors(@form-colors; (@index - 1));
@color: extract(@form-colors, @index);
.cp-form-palette-color@{index}{
&.cp-form-palette {
background-color: @color !important;
}
}
&.cp-form-palette-color@{index}{
#cp-app-form-editor {
background-color: fade(@color, 50%);
}
}
}
.form-colors(@form-colors; length(@form-colors));
@form-colors2: @cp_form-palette2;
.checkmark-colors(@form-colors2; @index) when (@index > 0){
.checkmark-colors(@form-colors2; (@index - 1));
@color: extract(@form-colors2, @index);
&.cp-form-palette-color@{index}{
.cp-form-block {
.cp-radio input:checked ~ .cp-radio-mark, .cp-checkmark input:checked ~ .cp-checkmark-mark {
background-color: @color !important;
border-color: @color !important;
}
input, textarea {
border-color: @color !important;
}
}
.cp-form-block-question-text, .cp-form-block-question-number {
color: @color !important;
}
.cp-form-type-sort:hover {
color: @color !important;
.cp-form-sort-order {
border-color: @color !important;
}
}
.cp-form-input-block {
input { color: @color !important; }
border-bottom-color: @color !important;
}
}
}
.checkmark-colors(@form-colors2; length(@form-colors2));
.cp-form-palette {
&.cp-form-palette-nocolor {
background-color: @palette0 !important;
}
}
&.cp-form-palette-nocolor {
background-color: @cp_app-bg !important;
}
div.alert.cp-burn-after-reading {
margin: 10px !important;
}
& > .flatpickr-calendar {
animation: none !important;
-webkit-animation: none !important;
}
#cp-app-form-editor {
flex: 1;
display: flex;
@ -54,7 +130,7 @@
.cp-form-block {
cursor: default !important;
.cp-form-block-drag-handle {
display: none !important;
visibility: hidden;
}
}
}
@ -74,51 +150,32 @@
height: 200px;
}
/*
table.cp-chart-table {
--color: @colortheme_apps[pad];
margin-top: 2em;
margin-right: auto;
min-width: 400px;
padding-bottom: 2rem;
width: min-content;
tr {
min-height: 200px;
min-width: max-content;
position: relative;
}
td {
margin: 1px;
min-width: 20px;
max-width: 30px;
border: 1px solid @cryptpad_color_brand_fadest;
}
th {
position: absolute;
bottom: -1.5rem;
left: 50%;
transform: translateX(-50%);
}
tr:not(:first-of-type):not(:last-of-type):not(:nth-of-type(5n+1)) {
th {
visibility: hidden;
}
}
.cp-bar:not(:hover) {
color: transparent;
}
}
*/
.cp-form-input-block {
display: flex;
}
.cp-form-view-title {
margin-bottom: 20px;
}
div.cp-form-view-footer {
display: flex;
align-items: center;
justify-content: center;
padding: 20px 20px 150px 20px;
div.cp-form-view-logo {
padding: 10px;
font-size: 40px;
font-family: "IBM Plex Mono";
.tools_unselectable();
color: @cryptpad_color_grey_500;
cursor: pointer;
img {
max-height: 60px;
margin: 0px 20px;
}
}
}
div.cp-form-creator-container {
display: flex;
flex: 1;
@ -134,20 +191,72 @@
width: 100% !important;
.cp-form-creator-settings {
display: flex;
justify-content: space-evenly;
justify-content: space-between;
flex-wrap: wrap;
& > div {
flex-basis: 33.333333%;
padding-right: 20px;
}
}
}
}
@media screen and (max-width: 600px) and (min-width: 400px) {
.cp-form-creator-settings {
& > div {
flex-basis: 50% !important;
}
}
}
@media screen and (max-width: 400px) {
.cp-form-creator-settings {
& > div {
flex-basis: 100% !important;
}
}
}
.cp-form-creator-settings {
padding: 30px;
.cp-form-actions {
margin-top: 5px;
}
& > div:not(:last-child) {
margin-bottom: 20px;
}
.cp-forms-results-participant {
display: flex;
flex-flow: column;
button {
margin-bottom: 20px;
}
}
.cp-form-color-container {
& > div {
display: flex;
justify-content: space-between;
margin-top: 5px;
&:last-child {
justify-content: space-evenly;
}
.cp-form-palette {
display: inline-block;
border-radius: 50%;
height: 30px;
width: 30px;
text-align: center;
line-height: 30px;
color: @cp_kanban-fg;
border: 1px solid fade(@cp_kanban-fg, 40%);
cursor: pointer;
}
}
}
.cp-form-response-msg-container button {
white-space: initial;
line-height: 25px;
padding: 5.5px 6px;
}
}
div.cp-form-filler-container {
width: 300px;
@ -156,6 +265,7 @@
}
div.cp-form-creator-control {
padding: 10px;
margin-top: 10px;
display: flex;
flex-flow: column;
width: 300px;
@ -165,6 +275,74 @@
flex-flow: column;
}
}
div.cp-form-creator-content {
.cp-form-block-type {
margin-top: -35px;
&.editable {
cursor: pointer;
}
.fa-caret-down {
margin-left: 5px;
}
}
.cp-form-conditional {
.cp-form-conditional-hint {
margin-bottom: 10px;
}
.cp-form-condition {
display: flex;
align-items: center;
margin-bottom: 10px;
flex-wrap: wrap;
& > * {
margin-right: 10px;
}
.cp-dropdown-container button {
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.cp-form-condition-rule {
padding-bottom: 20px;
margin-bottom: 20px;
border-bottom: 1px solid @cryptpad_text_col;
}
}
div.cp-form-section-sortable {
min-height: 300px;
border: 2px dashed @cryptpad_text_col;
padding: 20px;
margin-top: 20px;
background: @cp_app-bg;
.cp-form-creator-add-inline {
button[data-type="section"] {
display: none;
}
}
}
}
div.cp-form-creator-results {
.cp-form-block {
.cp-form-block-content {
overflow-x: auto;
}
}
.cp-form-creator-results-timeline {
margin-bottom: 20px;
table.cp-charts.column {
overflow-x: initial;
td {
background-color: @cp_form_bar_color;
border-color: @cp_form_bar_color;
}
}
}
}
div.cp-form-creator-content, div.cp-form-creator-results {
max-width: 1000px;
min-width: 300px;
@ -283,6 +461,7 @@
color: @cp_form-invalid;
ul {
list-style-type: disclosure-closed;
margin-bottom: 5px;
}
li {
text-align: left;
@ -290,6 +469,10 @@
color: @cryptpad_color_link;
}
}
.alert-danger {
font-size: 1rem;
padding: 10px;
}
}
.cp-form-anon-answer {
text-align: center;
@ -303,6 +486,10 @@
margin-left: 10px;
}
}
.cp-form-anon-answer-registered {
font-style: italic;
margin-left: 10px;
}
}
}
@ -330,13 +517,27 @@
.cp-form-block {
background: @cp_form-bg1;
padding: 10px;
box-shadow: 0px 0px 15px @cp_shadow-color;
&:not(:last-child) {
margin-bottom: 20px;
}
.cp-form-disabled {
.cp-form-poll-choice, .cp-form-type-sort {
cursor: not-allowed !important;
}
}
.cp-form-preview {
color: @cp_sidebar-hint;
margin-bottom: 10px;
padding: 0;
}
.cp-form-block-drag-handle {
display: flex;
flex-flow: column;
height: 25px;
align-items: center;
color: @cp_sidebar-hint;
i {
@ -359,18 +560,43 @@
.cp-form-block-question {
margin-bottom: 5px;
display: flex;
.cp-form-block-question-number {
font-weight: bold;
margin-right: 10px;
}
.cp-form-block-question-text {
flex: 1;
}
.cp-form-required-tag {
background: fade(@cryptpad_text_col, 15%);
padding: 5px;
margin-top: -10px;
margin-right: -10px;
&.cp-is-empty {
padding: 3px;
border: 2px solid @cryptpad_color_red;
color: @cp_form-invalid;
}
}
}
.cp-form-block-content {
overflow-x: auto;
p {
a {
color: @cryptpad_color_link;
}
}
.cp-form-required-radio {
flex-direction: row;
display: flex;
margin-bottom: 20px;
span {
margin-right: 10px;
&.cp-radio-mark {
margin-right: 5px;
}
}
}
.cp-form-page-break-edit {
font-size: 20px;
text-align: center;
@ -481,7 +707,12 @@
}
}
.cp-form-edit-block {
&.cp-no-sortable {
.cp-form-handle {
visibility: hidden;
cursor: default;
}
}
button.btn-secondary {
margin-left: 30px;
margin-bottom: 5px;
@ -516,6 +747,22 @@
}
}
}
div.cp-form-creator-answered {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
flex-flow: column;
.cp-form-submit-actions {
button:not(:last-child) {
margin-right: 10px;
}
}
.cp-form-view-logo {
margin-top: 100px;
padding-bottom: 20px;
}
}
div.cp-form-creator-results {
display: flex;
flex-flow: column;
@ -528,11 +775,13 @@
p:last-child {
margin-bottom: 0;
}
* {
max-width: 100%;
}
}
.cp-form-creator-results-controls {
margin-bottom: 20px;
margin-top: 20px;
//background: @cp_form-bg1;
//padding: 10px;
button {
@ -543,21 +792,13 @@
.cp-form-creator-results-content {
padding-bottom: 100px;
.cp-form-block {
background: @cp_form-bg1;
padding: 10px;
background: @cp_form-bg1;
padding: 10px;
}
}
.cp-form-block-question {
margin-bottom: 5px;
}
.cp-form-block-type {
float: right;
padding: 5px;
margin-top: -10px;
margin-right: -10px;
i { margin-right: 5px; }
background: fade(@cryptpad_text_col, 15%);
}
.cp-form-results-type-text {
max-height: 300px;
overflow: auto;
@ -573,26 +814,52 @@
background: @cp_form-bg2;
&:not(:last-child) { margin-bottom: 1px; }
}
.cp-form-results-type-radio {
display: table;
.cp-form-results-type-multiradio-data {
display: flex;
flex-flow: column;
.cp-form-results-cell() {
border: 1px solid @cp_form-border;
display: table-cell;
padding: 5px 10px;
background: @cp_form-bg2;
}
.cp-form-results-type-multiradio-data {
.cp-mr-q {
font-weight: bold;
padding: 5px 10px;
.cp-form-results-cell();
background: transparent;
}
.cp-form-results-type-radio-data {
display: table-row;
border: 1px solid @cp_form-border;
& > span {
border: 1px solid @cp_form-border;
display: table-cell;
padding: 5px 10px;
background: @cp_form-bg2;
&.cp-value {
min-width: 200px;
&:not(:first-child) {
.cp-mr-q {
margin-top: 15px;
}
}
}
.cp-charts {
.cp-charts-row {
.cp-grid-sub-question {
background: transparent;
}
.cp-value {
min-width: 200px;
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.cp-bar-container {
.cp-bar {
background-color: @cp_form_bar_color;
}
}
}
}
.cp-form-results-contained {
max-height: 350px; // enough for 10 table entries
overflow: auto;
}
.cp-form-individual {
background: @cp_form-bg1;
padding: 10px;
@ -614,6 +881,14 @@
}
}
}
.cp-form-block-type {
float: right;
padding: 5px;
margin-top: -10px;
margin-right: -10px;
i { margin-right: 5px; }
background: fade(@cryptpad_text_col, 10%);
}
}
.cp-form-type-radio, .cp-form-type-checkbox {
@ -844,6 +1119,11 @@
color: @cp_form-poll-yes-color;
}
}
.cp-form-response-modal {
.CodeMirror {
border: 1px solid @cp_forms-border;
}
}
.charts_main();
}

File diff suppressed because it is too large Load Diff

View File

@ -125,7 +125,7 @@ define([
var noDriveAnswered = false;
nThen(function (w) {
require([
'/bower_components/chainpad-netflux/chainpad-netflux.js',
'chainpad-netflux',
'/common/pinpad.js',
], w(function (_CPNetflux, _Pinpad) {
CPNetflux = _CPNetflux;
@ -176,7 +176,7 @@ define([
validateKey: keys.secondaryValidateKey,
owners: [myKeys.edPublic],
crypto: crypto,
//Cache: Utils.Cache // XXX 4.10.0
//Cache: Utils.Cache // TODO enable cache for form responses when the cache stops evicting old answers
};
var results = {};
config.onError = function (info) {
@ -221,6 +221,7 @@ define([
delete results[parsed._proof.key];
}
}
if (data.cantEdit && results[senderCurve]) { return; }
results[senderCurve] = {
msg: parsed,
hash: hash,
@ -266,14 +267,21 @@ define([
if (obj && obj.error) { return void cb(obj); }
var messages = obj.messages;
if (!messages.length) { return void cb(); }
var res = Utils.Crypto.Mailbox.openOwnSecretLetter(messages[0].msg, {
validateKey: data.validateKey,
ephemeral_private: Nacl.util.decodeBase64(answer.curvePrivate),
my_private: Nacl.util.decodeBase64(myKeys.curvePrivate),
their_public: Nacl.util.decodeBase64(data.publicKey)
});
res.content._isAnon = answer.anonymous;
cb(JSON.parse(res.content));
if (obj.lastKnownHash !== answer.hash) { return void cb(); }
try {
var res = Utils.Crypto.Mailbox.openOwnSecretLetter(messages[0].msg, {
validateKey: data.validateKey,
ephemeral_private: Nacl.util.decodeBase64(answer.curvePrivate),
my_private: Nacl.util.decodeBase64(myKeys.curvePrivate),
their_public: Nacl.util.decodeBase64(data.publicKey)
});
var parsed = JSON.parse(res.content);
parsed._isAnon = answer.anonymous;
parsed._time = messages[0].time;
cb(parsed);
} catch (e) {
cb({error: e});
}
});
});

View File

@ -1,17 +1,43 @@
define([
'/customize/messages.js'
], function (Messages) {
var pollValues = [];
var d8 = new Date();
d8.setDate(d8.getDate() - d8.getDay() + 7); // set sunday
d8.setHours(8);
d8.setMinutes(0);
d8.setSeconds(0);
d8.setMilliseconds(0);
var d14 = new Date(d8);
d14.setHours(14);
[0,1,2].forEach(function (el) {
d8.setDate(d8.getDate() + 1);
d14.setDate(d14.getDate() + 1);
if (el === 2) {
d8.setHours(10);
}
pollValues.push(+d8);
if (el === 2) { return; }
pollValues.push(+d14);
});
return [{
id: 'a',
used: 1,
name: Messages.form_type_poll,
name: Messages.form_template_poll,
content: {
answers: {
anonymous: true,
},
form: {
"1": {
type: 'md'
},
"2": {
type: 'poll'
type: 'poll',
opts: {
type: 'time',
values: pollValues
}
}
},
order: ["1", "2"]

View File

@ -159,6 +159,14 @@
margin-right: 5px;
.tools_unselectable();
cursor: default;
&.cp-cursor.cp-tippy-html {
.avatar_vars(20px);
background-color: var(--red);
font-size: @avatar-font-size;
&.animal {
font-size: @avatar-font-size-animal;
}
}
}
}
.kanban-item {

View File

@ -97,16 +97,28 @@ define([
// Tippy
var html = MT.getCursorAvatar(cursor);
var l = Util.getFirstCharacter(cursor.name || Messages.anonymous);
var name = UI.getDisplayName(cursor.name);
var l; // label?
var animal = '';
if (cursor.name === Messages.anonymous && typeof(cursor.uid) === 'string') {
l = MT.getPseudorandomAnimal(cursor.uid);
if (l) {
animal = '.animal';
}
}
if (!l) {
l = MT.getPrettyInitials(name);
}
var text = '';
if (cursor.color) {
text = 'color:'+getTextColor(cursor.color)+';';
text = 'background-color:' + cursor.color + '; color:'+getTextColor(cursor.color)+';';
}
var avatar = h('span.cp-cursor.cp-tippy-html', {
style: "background-color: " + (cursor.color || 'red') + ";"+text,
var avatar = h('span.cp-cursor.cp-tippy-html' + animal, {
style: text,
'data-cptippy-html': true,
title: html
title: html,
}, l);
if (!noClear) {
cursor.clear = function () {
@ -563,12 +575,12 @@ define([
"12": {
"id": 12,
"title": Messages.kanban_working,
"item": [3, 4]
"item": [],
},
"13": {
"id": 13,
"title": Messages.kanban_done,
"item": [5, 6]
"item": [],
}
},
items: items
@ -1009,8 +1021,8 @@ define([
var common = framework._.sfCommon;
var $button = common.createButton('toggle', true, {
element: $(container),
//icon: 'fa-tags', // FIXME
//text: Messages.fm_tagsName, // FIXME
icon: 'fa-tags',
text: Messages.fm_tagsName,
}, function () {
$button.toggleClass('cp-toolbar-button-active');
@ -1295,12 +1307,12 @@ define([
// Add new cursor
var avatar = getAvatar(cursor);
var $item = $('.kanban-item[data-eid="'+cursor.item+'"]');
var $board = $('.kanban-board[data-id="'+cursor.board+'"]');
if ($item.length) {
remoteCursors[id] = cursor;
$item.find('.cp-kanban-cursors').append(avatar);
return;
}
var $board = $('.kanban-board[data-id="'+cursor.board+'"]');
if ($board.length) {
remoteCursors[id] = cursor;
$board.find('header .cp-kanban-cursors').append(avatar);

File diff suppressed because one or more lines are too long

View File

@ -43,18 +43,21 @@ define([
var canonicalize = function(t) { return t.replace(/\r\n/g, '\n'); };
var getAuthorId = function(Env, curve) {
return Env.common.getAuthorId(Env.comments.authors, curve);
var getAuthorId = function(Env, curve, uid) {
return Env.common.getAuthorId(Env.comments.authors, curve, uid);
};
// Return the author ID and add/update the data for registered users
// Return the username for unregistered users
// Return the author ID and add/update user data
// associate data with a curvePublic for registered users and the uid otherwise
var updateAuthorData = function(Env, onChange) {
var userData = Env.metadataMgr.getUserData();
var myAuthorId;
if (!Env.common.isLoggedIn()) {
return userData.name;
myAuthorId = getAuthorId(Env, undefined, userData.uid);
} else {
myAuthorId = getAuthorId(Env, userData.curvePublic);
}
var myAuthorId = getAuthorId(Env, userData.curvePublic);
var data = Env.comments.authors[myAuthorId] = Env.comments.authors[myAuthorId] || {};
var old = Sortify(data);
data.name = userData.name;
@ -62,6 +65,8 @@ define([
data.profile = userData.profile;
data.curvePublic = userData.curvePublic;
data.notifications = userData.notifications;
data.uid = userData.uid;
if (typeof(onChange) === "function" && Sortify(data) !== old) {
onChange();
}
@ -82,6 +87,9 @@ define([
var userData = Env.metadataMgr.getUserData();
var privateData = Env.metadataMgr.getPrivateData();
var others = {};
// XXX mentioned users should be excluded from the list of notified recipients to avoid notifying them twice
// Get all the other registered users with a mailbox
thread.m.forEach(function(obj) {
var u = obj.u;
@ -93,7 +101,8 @@ define([
curvePublic: author.curvePublic,
comment: obj.m,
content: obj.v,
notifications: author.notifications
notifications: author.notifications,
uid: author.uid,
};
});
// Send the notification
@ -146,7 +155,7 @@ define([
'aria-required': true,
contenteditable: true,
});
Env.common.displayAvatar($(avatar), userData.avatar, name);
Env.common.displayAvatar($(avatar), userData.avatar, name, Util.noop, userData.uid);
var cancel = h('button.btn.btn-cancel', {
tabindex: 1
@ -224,7 +233,9 @@ define([
if (Env.common.isLoggedIn()) {
var authors = {};
Object.keys((Env.comments && Env.comments.authors) ||  {}).forEach(function(id) {
Object.keys((Env.comments && Env.comments.authors) ||  {})
.filter(function (id) { return Util.find(Env, ['commments', 'authors', id, 'curvePublic']); })
.forEach(function(id) {
var obj = Util.clone(Env.comments.authors[id]);
authors[obj.curvePublic] = obj;
});
@ -369,7 +380,7 @@ define([
var name = Util.fixHTML(author.name || Messages.anonymous);
var date = new Date(msg.t);
var avatar = h('span.cp-avatar');
Env.common.displayAvatar($(avatar), author.avatar, name);
Env.common.displayAvatar($(avatar), author.avatar, name, Util.noop, author.uid);
if (author.profile) {
$(avatar).click(function(e) {
Env.common.openURL(Hash.hashToHref(author.profile, 'profile'));
@ -393,7 +404,7 @@ define([
}
cleanMentions($el);
var avatar = h('span.cp-avatar');
Env.common.displayAvatar($(avatar), avatarUrl, name);
Env.common.displayAvatar($(avatar), avatarUrl, name, Util.noop, author.uid);
$el.append([
avatar,
h('span.cp-mentions-name', name)

View File

@ -3,7 +3,9 @@ define([
'/common/common-ui-elements.js',
'/common/common-interface.js',
'/bower_components/chainpad/chainpad.dist.js',
], function ($, UIElements, UI, ChainPad) {
'/customize/messages.js',
'/common/inner/common-mediatag.js',
], function ($, UIElements, UI, ChainPad, Messages, MT) {
var Cursor = {};
Cursor.isCursor = function (el) {
@ -40,8 +42,17 @@ define([
var cursors = {};
// FIXME despite the name of this function this doesn't actually render as a tippy tooltip
// that means that emojis will use the system font that shows up in native tooltips
// so this might be of limited value/aesthetic appeal compared to other apps' cursors
var makeTippy = function (cursor) {
return cursor.name;
if (typeof(cursor.uid) === 'string' && (!cursor.name || cursor.name === Messages.anonymous)) {
var animal = MT.getPseudorandomAnimal(cursor.uid);
if (animal) {
return animal + ' ' + Messages.anonymous;
}
}
return cursor.name || Messages.anonymous;
};
var makeCursor = function (id, cursor) {

View File

@ -7,7 +7,7 @@ define([
'/common/sframe-common.js',
'/common/common-realtime.js',
'/customize/application_config.js',
'/bower_components/chainpad-listmap/chainpad-listmap.js',
'chainpad-listmap',
'/poll/render.js',
'/poll/export.js',
'/common/diffMarked.js',

View File

@ -1,7 +1,7 @@
define([
'jquery',
'/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad-listmap/chainpad-listmap.js',
'chainpad-listmap',
'/common/toolbar.js',
'/bower_components/nthen/index.js',
'/common/sframe-common.js',
@ -348,8 +348,8 @@ define([
if (!val) {
$('<img>', {
src: '/customize/images/avatar.png',
title: Messages.profile_avatar,
alt: 'Avatar'
title: Messages.profile_defaultAlt,
alt: Messages.profile_defaultAlt,
}).appendTo($span);
return;
}

View File

@ -10,7 +10,7 @@ define([
'/common/cryptpad-common.js',
'/common/outer/cache-store.js',
'/common/common-interface.js',
'/bower_components/chainpad-netflux/chainpad-netflux.js',
'chainpad-netflux',
'/bower_components/chainpad-crypto/crypto.js',
'/common/userObject.js',
'/common/clipboard.js',

View File

@ -22,6 +22,8 @@
.usergrid_main();
.forms_main();
.fa-shhare-alt:before { content: "\f1e0"; }
#cp-filepicker-dialog {
display: none;
.cp-modal {

View File

@ -34,5 +34,14 @@
color: @cryptpad_color_link;
text-decoration: underline;
}
.alert-info {
font-size: 16px;
margin-top: 15px;
margin-bottom: 15px;
}
// add some whitespace to improve readability a bit
br {
margin: 5px;
}
}

View File

@ -45,6 +45,7 @@ define([
'cp-support-list',
],
'new': [ // Msg.support_cat_new
'cp-support-subscribe',
'cp-support-language',
'cp-support-form',
],
@ -166,6 +167,26 @@ define([
return $div;
};
create['subscribe'] = function () {
if (!Pages.areSubscriptionsAllowed()) { return; }
var url = Pages.accounts.upgradeURL;
var accountsLink = h('a', {
href: url,
}, Messages.support_premiumLink);
$(accountsLink).click(function (ev) {
ev.preventDefault();
common.openURL(url);
});
return $(h('div.cp-support-subscribe.cp-sidebarlayout-element', [
h('div.alert.alert-info', [
Messages.support_premiumPriority,
' ',
accountsLink,
]),
]));
};
// Create a new tickets
create['form'] = function () {
var key = 'form';

View File

@ -10,14 +10,12 @@ define([
'/customize/messages.js',
], function ($, ApiConfig, h, UI, Hash, Util, Clipboard, UIElements, Messages) {
var send = function (ctx, id, type, data, dest) {
var getDebuggingData = function (ctx, data) {
var common = ctx.common;
var supportKey = ApiConfig.supportMailbox;
var supportChannel = Hash.getChannelIdFromKey(supportKey);
var metadataMgr = common.getMetadataMgr();
var user = metadataMgr.getUserData();
var privateData = metadataMgr.getPrivateData();
var user = metadataMgr.getUserData();
var teams = privateData.teams || {};
data = data || {};
data.sender = {
@ -34,14 +32,12 @@ define([
data.sender.quota = ctx.pinUsage;
}
data.id = id;
data.time = +new Date();
var teams = privateData.teams || {};
if (!ctx.isAdmin) {
data.sender.userAgent = Util.find(window, ['navigator', 'userAgent']);
data.sender.vendor = Util.find(window, ['navigator', 'vendor']);
data.sender.appVersion = Util.find(window, ['navigator', 'appVersion']);
data.sender.screenWidth = Util.find(window, ['screen', 'width']);
data.sender.screenHeight = Util.find(window, ['screen', 'height']);
data.sender.blockLocation = privateData.blockLocation || '';
data.sender.teams = Object.keys(teams).map(function (key) {
var team = teams[key];
@ -55,7 +51,25 @@ define([
}
return ret;
}).filter(Boolean);
}
return data;
};
var send = function (ctx, id, type, data, dest) {
var common = ctx.common;
var supportKey = ApiConfig.supportMailbox;
var supportChannel = Hash.getChannelIdFromKey(supportKey);
var metadataMgr = common.getMetadataMgr();
var user = metadataMgr.getUserData();
var privateData = metadataMgr.getPrivateData();
data = getDebuggingData(ctx, data);
data.id = id;
data.time = +new Date();
if (!ctx.isAdmin) {
// "dest" is the recipient that is not the admin support mailbox.
// In the support page, make sure dest is always ourselves.
dest.channel = privateData.support;
@ -472,6 +486,10 @@ define([
ui.makeCloseMessage = function (content, hash) {
return makeCloseMessage(ctx, content, hash);
};
ui.getDebuggingData = function (data) {
return getDebuggingData(ctx, data);
};
return ui;
};

View File

@ -693,6 +693,8 @@ define([
redrawRoster(common);
});
};
var getDisplayName = UI.getDisplayName;
var makeMember = function (common, data, me, roster) {
if (!data.curvePublic) { return; }
@ -701,11 +703,12 @@ define([
return user.role === "OWNER" && user.curvePublic !== me.curvePublic && !user.pendingOwner;
});
var displayName = getDisplayName(data.displayName);
// Avatar
var avatar = h('span.cp-avatar.cp-team-member-avatar');
common.displayAvatar($(avatar), data.avatar, data.displayName);
common.displayAvatar($(avatar), data.avatar, displayName, Util.noop, data.uid);
// Name
var name = h('span.cp-team-member-name', data.displayName);
var name = h('span.cp-team-member-name', displayName);
if (data.pendingOwner) {
$(name).append(h('em', {
title: Messages.team_pendingOwnerTitle
@ -789,7 +792,7 @@ define([
title: Messages.team_rosterKick
});
$(remove).click(function () {
UI.confirm(Messages._getKey('team_kickConfirm', [Util.fixHTML(data.displayName)]), function (yes) {
UI.confirm(Messages._getKey('team_kickConfirm', [Util.fixHTML(displayName)]), function (yes) {
if (!yes) { return; }
APP.module.execCommand('REMOVE_USER', {
pending: data.pending,
@ -1073,6 +1076,9 @@ define([
metadata: obj
}, function () {
$avatar.empty();
// the UI is not supposed to allow admins to remove team names
// so we expect that it will be there. Failing that the initials
// from the default name will be displayed
common.displayAvatar($avatar, data.url);
});
});
@ -1093,8 +1099,8 @@ define([
if (!val) {
var $img = $('<img>', {
src: '/customize/images/avatar.png',
title: Messages.profile_avatar,
alt: 'Avatar'
title: Messages.profile_defaultAlt,
alt: Messages.profile_defaultAlt,
});
var mt = h('media-tag', $img[0]);
$avatar.append(mt);
@ -1191,10 +1197,11 @@ define([
var displayUser = function (common, data) {
var avatar = h('span.cp-teams-invite-from-avatar.cp-avatar');
common.displayAvatar($(avatar), data.avatar, data.displayName);
var name = getDisplayName(data.displayName);
common.displayAvatar($(avatar), data.avatar, name);
return h('div.cp-teams-invite-from-author', [
avatar,
h('span.cp-teams-invite-from-name', data.displayName)
h('span.cp-teams-invite-from-name', name)
]);
};
@ -1316,23 +1323,31 @@ define([
});
};
var isValidInvitationLinkContent = function (json) {
if (!json) { return false; }
if (json.error || !Object.keys(json).length) { return false; }
if (!json.author) { return false; }
return true;
};
nThen(function (waitFor) {
// Get preview content.
sframeChan.query('Q_ANON_GET_PREVIEW_CONTENT', { seeds: seeds }, waitFor(function (err, json) {
if (json && (json.error || !Object.keys(json).length)) {
if (!isValidInvitationLinkContent(json)) {
$(errorBlock).text(Messages.team_inviteInvalidLinkError).show();
waitFor.abort();
$div.empty();
return;
}
// FIXME nothing guarantees that teamName or author.displayName exist in json
$div.empty();
$div.append(h('div.cp-teams-invite-from', [
Messages.team_inviteFrom || 'From:',
Messages.team_inviteFrom,
displayUser(common, json.author)
]));
$div.append(UI.setHTML(h('p.cp-teams-invite-to'),
Messages._getKey('team_inviteFromMsg',
[Util.fixHTML(json.author.displayName),
[Util.fixHTML(getDisplayName(json.author.displayName)),
Util.fixHTML(json.teamName)])));
if (json.message) {
$div.append(h('div.cp-teams-invite-message', json.message));
@ -1449,10 +1464,10 @@ define([
// Update the name in the user menu
var $displayName = $bar.find('.' + Toolbar.constants.username);
metadataMgr.onChange(function () {
var name = metadataMgr.getUserData().name || Messages.anonymous;
var name = getDisplayName(metadataMgr.getUserData().name);
$displayName.text(name);
});
$displayName.text(user.name || Messages.anonymous);
$displayName.text(getDisplayName(user.name));
// Load the Team module
var onEvent = function (obj) {

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>CryptPad</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="referrer" content="no-referrer" />
<script async data-main="/test/inner.js" src="/bower_components/requirejs/require.js?ver=2.3.6"></script>
<link href="/lib/chart/charts.min.css" rel="stylesheet" type="text/css">
</head>
<body>

View File

@ -1,68 +0,0 @@
define([
'/common/hyperscript.js',
'/common/inner/charts.js',
], function (h, Charts) {
var wrap = function (content) {
return h('div', {
style: 'height: 500px; width: 500px; padding: 15px; border: 1px solid #222; margin: 15px;'
}, content);
};
var append = function (el) {
document.body.appendChild(el);
};
var data = [
25, 58, 5, 96, 79,
23, 75, 13, 44, 29,
65, 80, 30, 47, 22,
7, 62, 64, 46, 21,
29, 31, 76, 65, 61,
78, 58, 12, 90, 98,
37, 75, 92, 74, 16,
17, 52, 42, 71, 19
];
append(h('h1', 'Charts'));
append(h('hr'));
var cell = (function () {
var i = 0;
return function () {
var val = data[i++];
return h('td', {
style: '--size: ' + (val / 100),
}, val);
};
}());
var multirow = function (n) {
var cells = [];
while (n--) {
cells.push(cell());
}
return h('tr', {
style: 'margin: 15px',
}, cells);
};
append(wrap(Charts.table([
h('tbody', [
multirow(4),
multirow(4),
multirow(4),
multirow(4),
]),
], [
'charts-css',
'bar',
'multiple',
])));
append(h('hr'));
append(wrap(Charts.columns([ 40, 60, 75, 90, 100])));
append(wrap(Charts.columns(data.slice(20))));
});

View File

@ -1,7 +1,7 @@
define([
'jquery',
'/bower_components/chainpad-crypto/crypto.js',
'/bower_components/chainpad-listmap/chainpad-listmap.js',
'chainpad-listmap',
'/common/toolbar.js',
'/bower_components/nthen/index.js',
'/common/sframe-common.js',