Commit graph

101 commits

Author SHA1 Message Date
Richard Hansen
cc688f7367 ace: Delete dead code 2021-11-07 23:24:39 -05:00
Richard Hansen
c7be4f9d2d ace2_inner: Move sidedivinner creation to ace.js 2021-08-16 00:31:09 -04:00
Volker Bijewitz
84d6d277d7 Accessibility fix for JAWS screen readers
ace.js: removed the role 'application' from innerDocument.body. JAWS
do not read any text from the edit lines if this role is set.

domline.createDomLine: to give JAWS the ability to read the lines
correctly, it is required to set the attribute 'aria-live' to
'assertive'.
2021-08-12 13:48:08 -04:00
webzwo0i
e61888dfe2 ace.js: Don't use srcdoc when creating iframes (see #4975)
Using srcdoc, especially with multiple nested iframes, seems to be
problematic when using `self` in CSP policies.
2021-07-30 03:51:57 -04:00
Richard Hansen
0c963a817a ace2_inner.js: Delete unnecessary ace_outerWin variable 2021-07-30 03:51:56 -04:00
Richard Hansen
5d39a57507 Pad: Delete dead ace_getFormattedCode() 2021-07-30 03:49:35 -04:00
Richard Hansen
9fcd86b3cd Pad: Fix <script> elements in aceInitInnerdocbodyHead hook
Using `.innerHTML` to create a `<script>` element does create a DOM
node, but the script is not actually executed. Fortunately, creating a
DocumentFragment does cause the script to execute.
2021-06-18 17:50:15 -04:00
Richard Hansen
63a1f078f4 collab_client: Redo server message queueing
Move server message queue processing out of `handleUserChanges()` for
the following reasons:
  * Fix a race condition: Before this change the client would stop
    processing incoming messages and stop sending changes to the
    server if a `NEW_CHANGES` message arrived while the user was
    composing a character and waiting for an `ACCEPT_COMMIT` message.
  * Improve readability: The `handleUserChanges()` function is for
    handling changes from the local user, not for handling changes
    from other users.
  * Simplify the code.
2021-03-30 16:42:53 -04:00
webzwo0i
c208d50c4a add version string to iframe_editor.css 2021-03-20 16:42:08 +00:00
Richard Hansen
3ad1d0a74f cssmanager: Refactor CSS manager creation to avoid race condition
Safari takes a while to initialize `document.styleSheets`, which
results in a race condition when loading the pad. Avoid the race
condition by accessing the CSSStyleSheet objects directly from the
HTMLStyleElement DOM objects.
2021-03-20 01:07:16 +00:00
Richard Hansen
81e36cf3c7 Ace2Inner: Promisify init() 2021-03-20 01:07:16 +00:00
Richard Hansen
cb9f6d6776 ace: Use iframe srcdoc property to refine frame load logic
This seems to fix "null is not an object (evaluating
'browserSheet.insertRule')" errors on Safari.
2021-03-19 17:06:58 +01:00
Richard Hansen
404486069c ace: Build the outer and inner iframes programmatically
This makes the code easier to read and it silences Chrome's
`document.write()` warning:
https://developers.google.com/web/updates/2016/08/removing-document-write

This is a redo of commit a17f9bf3cf,
which was reverted in commit 912f0f195f
due to a CSS bug.
2021-03-05 19:31:59 +00:00
Richard Hansen
5546cc5e7b CSS: Delete bogus <link> tag
Browsers report an error with this tag. Strangely, this tag has
existed since Etherpad's very first commit.
2021-03-05 07:45:48 +00:00
Richard Hansen
48e1d1c23f CSS: Fix class name for outer iframe <html> tag
* Add the class "pad" to the `<html>` tag in `pad.html` (the outer
    iframe's parent).
  * Change the CSS selector that refers to the `<html>` tag in
    `pad.html` from `html:not(.inner-editor)` to `html.pad`.
  * Change the class name of the outer iframe's `<html>` tag from
    "inner-editor" to "outer-editor".
  * Update CSS rules to use the new class name.
2021-03-05 07:45:48 +00:00
Richard Hansen
912f0f195f Revert "ace: Build the outer and inner iframes programmatically"
This reverts commit a17f9bf3cf, which
caused a mysterious bug with the line numbers. Revert to avoid
blocking a new release while I figure out the bug.
2021-03-04 02:05:54 +00:00
Richard Hansen
b0862cd030 ace: Delete all $$INCLUDE_CSS logic
The intention of the deleted code was to reduce the number of fetches,
but it only saved a single fetch due to implementation flaws. The
right way to reduce the number of fetches is to use a bundling
technology such as webpack, and this change makes it easier to do so.
2021-03-01 14:32:33 +00:00
Richard Hansen
66d3ac3783 ace: Debug logging 2021-03-01 14:32:33 +00:00
Richard Hansen
a17f9bf3cf ace: Build the outer and inner iframes programmatically
This makes the code easier to read and it silences Chrome's
`document.write()` warning:
https://developers.google.com/web/updates/2016/08/removing-document-write
2021-03-01 14:32:33 +00:00
Richard Hansen
c696732838 ace: Asyncify Ace2Editor.init() 2021-03-01 14:32:33 +00:00
Richard Hansen
159fd5bdeb ace: Simplify passing of editorInfo 2021-03-01 14:32:33 +00:00
Richard Hansen
e57829183d ace: Pass objects to Ace2Inner via function args 2021-03-01 14:32:33 +00:00
Richard Hansen
6fe0154129 ace: Use absolute URLs when building iframes
This isn't strictly necessary right now, but will become
necessary (due to a Safari quirk) when we change to building the
iframes programmatically (vs. the current `document.write()`
approach).
2021-03-01 14:32:33 +00:00
Richard Hansen
9cfc2fb801 ace: Simplify the aceEditorCSS hook map function 2021-03-01 14:32:33 +00:00
Richard Hansen
94c221586c ace: Factor out duplicated $$INCLUDE_CSS code 2021-03-01 14:32:33 +00:00
Richard Hansen
54df7f3728 ace: Delete unused clientVars.disableCustomScriptsAndStyles 2021-03-01 14:32:33 +00:00
Richard Hansen
d84447290e ace: Delete unnecessary IIFE 2021-03-01 14:32:33 +00:00
Richard Hansen
3a311d2182 ace: Lint and simplify script strings 2021-03-01 14:32:33 +00:00
Richard Hansen
c9b1f17f25 ace: Format script strings for readability 2021-03-01 14:32:33 +00:00
Richard Hansen
b3416c4eeb ace: Delete ignored class attribute 2021-03-01 14:32:33 +00:00
Richard Hansen
c9c8b27854 ace: Delete unused Ace2Editor.getFrame() method 2021-03-01 14:32:33 +00:00
webzwo0i
348d08c79e ensure version string is attached for inner frame resources 2021-02-27 16:28:12 +00:00
webzwo0i
01dd9f5440 speed up page load 2021-02-27 16:28:12 +00:00
webzwo0i
fa29858a4e avoid manually including require-kernel in ace.js 2021-02-25 16:59:06 +00:00
Richard Hansen
8ae8710a14 ace: Fix EMBEDDED check 2021-02-12 07:08:51 +00:00
Richard Hansen
1c9afa5168 lint: src/static/js/ace.js 2021-02-07 20:04:07 +00:00
Richard Hansen
8668017c62 ace: Use globalThis instead of non-strict default context
This is necessary before `'use strict';` can be added to the top of
the file.
2021-02-07 20:04:07 +00:00
Richard Hansen
3c2e0f0e16 ace: Simplify Ace2Editor method creation
* Delete the unused `optDoNow` parameter from `pendingInit()`.
  * Move the `setAuthorInfo()` 1st parameter check out of the wrapper
    and in to the `setAuthorInfo()` function itself.
2021-02-07 20:04:07 +00:00
Richard Hansen
f54dcbc766 lint: Re-run eslint --fix 2020-12-16 22:09:48 +00:00
Richard Hansen
8e5fd19db2 lint: Run eslint --fix on src/ 2020-11-24 20:06:12 +00:00
Richard Hansen
7df3ded66f lint: Put opening brace on same line as function
Normally I would let `eslint --fix` do this for me, but there's a bug
that causes:

    const x = function ()
    {
      // ...
    };

to become:

    const x = ()
    => {
      // ...
    };

which ESLint thinks is a syntax error. (It probably is; I don't know
enough about the automatic semicolon insertion rules to be confident.)
2020-11-24 20:06:12 +00:00
Richard Hansen
da459888dc plugins: Move plugin definitions to avoid monkey patching
Also document the plugin data structures.
2020-09-08 00:50:24 +01:00
John McLear
00b6a1d9fe
Remove top console logs to stop hosted iFrames being broken. 2020-05-29 12:56:03 +01:00
muxator
6dd9e9adc8 assets: also use cache busting via query string in files imported from acs.js
Before this change, a client would require two versions of the same assets (with
and without randomVersionString), wasting resources and triggering all sorts of
hard to debug inconsistencies.

This change should have been part of 95fd5ce2a4 and completes it.
2020-05-15 01:29:13 +02:00
Sebastian Castro
709e5d2233 colibris: introduce skin variants, in order to customize the rendering
This provide a nice way to change the colors of main containers from settings file. See comment inside settings for how it works
2020-04-19 03:03:44 +02:00
Sebastian Castro
5fd6aeeea6 css: refactor element positioning
No more javascript to change css properties
Remove a number of useless tables
Try to stop positioning elements with absolute, but use flex-boxes instead

Adds comment to pad template, and move popups and chatbox inside editorcontainerbox (so absolute positioning is straightforward)

Make the design more consistent: always use base color, font-family and font-size. USe relative font size if necessary (.9rem instead of 11px for example)

Remove two columns in the popups, just use one column

Remove css meant to support old browser (like -webkit-box-shadow, -moz-box-shadow). Those css rules are quite common now, and If we want to support very old browser, we should use clean-css or other tools to add them automatically
2020-04-19 03:03:44 +02:00
John McLear
dbab4ad13a dont pass empty author info to edit 2020-04-02 23:29:03 +01:00
Sebastian Castro
4115f792e4 ace.js: prioritize the skin style over the plugin style
Preparatory work for introducing colibris skin
2018-11-08 21:55:34 +01:00
Sebastian Castro
8a6eae26d7 ace.js: also add plugins names to #outerdocbody (refs #3488)
This commit is an integration to aa8204e5dfe4
2018-11-08 21:55:07 +01:00
muxator
36f39a6e13 ace.js: remove template literals to keep IE 11 compatibility
Files in "src/static" are executed on the client: do not break browser
compatibility because of syntactic sugar.

Introduced in 9c990ab08a.
2018-08-27 02:18:34 +02:00