Commit graph

1705 commits

Author SHA1 Message Date
Richard Hansen
cccabf45b8 pad: Move error message to the top of the gritter box 2021-06-06 21:31:49 -04:00
Richard Hansen
b2e94685fb pad: Display error name in the gritter box 2021-06-06 21:31:40 -04:00
webzwo0i
3c087af038 caretPosition: fix loading when iframe is hidden 2021-05-04 23:56:13 +02:00
Richard Hansen
c00031a8d8 skiplist: Use Map.size to get number of nodes 2021-05-03 01:42:03 -04:00
Richard Hansen
1cdfe9193b skiplist: Convert _keyToNodeMap to a Map object 2021-05-03 01:42:03 -04:00
Richard Hansen
e2eb7327c2 skiplist: Sanity check inserted entries 2021-05-03 01:42:03 -04:00
Richard Hansen
9e2ef6ad5b skiplist: Move propagateWidthChange() to Node class 2021-05-03 01:42:03 -04:00
Richard Hansen
fc103e7f2a skiplist: Define a new Node class 2021-05-03 01:42:03 -04:00
Richard Hansen
9fc88f3601 skiplist: Convert point operations into Point methods 2021-05-03 01:42:03 -04:00
Richard Hansen
3c1be95e07 skiplist: Move point creation to a new Point class 2021-05-03 01:42:03 -04:00
Richard Hansen
8ae40e80f9 skiplist: Save entry in _insertKeyAtPoint() 2021-05-03 01:42:03 -04:00
Richard Hansen
0e424fa8c3 skiplist: Remove unnecessary newKey arg from _insertKeyAtPoint() 2021-05-03 01:42:03 -04:00
Richard Hansen
ab8c354f18 skiplist: Use ES6 class syntax
This makess it easier to examine state in dev console.
2021-05-03 01:42:03 -04:00
Richard Hansen
303fd297bd editor: Improve documentation comments 2021-05-03 01:42:03 -04:00
Richard Hansen
cbbcef8e90 AttributeManager: Add sanity checks 2021-05-03 01:42:03 -04:00
Richard Hansen
d40d59d9eb AttributeManager: Simplify logic 2021-05-03 01:42:03 -04:00
Richard Hansen
e3d32a26b6 skiplist: Delete unused methods 2021-05-03 01:42:03 -04:00
Richard Hansen
f650c3d73e editor: Delete unused PROFILER code 2021-05-03 01:42:03 -04:00
Richard Hansen
ab4e99f67a editor: Delete commented-out code 2021-05-03 01:42:03 -04:00
Richard Hansen
d01b593d3c chat: Ensure that ctx.text is interpreted as HTML 2021-04-11 06:20:29 +02:00
Richard Hansen
a3a0ff7bc1 chat: Use jQuery to build the chat message DOM object
This reduces the likelihood of accidentally introducing an XSS
vulnerability.
2021-04-11 06:20:29 +02:00
Richard Hansen
74554d36a5 chat: Allow chatNewMessage hook to modify more values 2021-04-11 06:20:29 +02:00
Richard Hansen
91e99c84ca import: Reduce log spam from unsupported elements 2021-04-09 18:43:02 +02:00
Richard Hansen
09c349e2a1 import: Use a Set for supported elements 2021-04-09 18:43:02 +02:00
webzwo0i
a796811558 escape userId before setting it as HTML attribute 2021-04-07 23:29:27 -04:00
Richard Hansen
7cbb3f565d tests: Speed up helper.edit() and helper.clearPad() 2021-04-02 15:46:27 +02:00
Richard Hansen
2776946627 tests: Use cookie libraries to manipulate cookies 2021-04-01 14:31:56 +02:00
Richard Hansen
202d65d2bb pad_cookie: Re-read prefs cookie on every call to getPref()
This makes it easier to write tests that clear the prefs cookie.
2021-04-01 14:31:56 +02:00
Richard Hansen
0df41a9a78 pad_cookie: Move initial cookie read+save to init()
Benefits of this change:
  * It avoids race conditions with tests that clear cookies.
  * Any attempt to get or set a value before `init()` is called will
    throw an error, ensuring the API is used properly.
  * Improved readability: It's easier to understand what the
    `pad.noCookie` check is doing.
2021-04-01 14:31:56 +02:00
Richard Hansen
1fdaf95c3b collab_client: Delete unused NO_COMMIT_PENDING handling 2021-03-30 16:42:53 -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
Richard Hansen
e99fe88537 collab_client: Use Date.now() instead of casting a Date object
Also rename the `t` variable to `now` to improve readability.
2021-03-30 16:42:53 -04:00
Richard Hansen
5c445eac21 collab_client: Convert state var to committing bool 2021-03-30 16:42:53 -04:00
Richard Hansen
3ee6b5eb2b collab_client: Delete unused caughtErrors 2021-03-30 16:42:53 -04:00
Richard Hansen
81b9a2544d collab_client: Factor out duplicate ACCEPT_COMMIT code 2021-03-30 16:42:53 -04:00
Richard Hansen
b9753dcc71 Changeset: Return a new op object by default when iterating
Reusing the same op object for each iteration can result in very weird
behaviors because previously yielded op objects will get a surprise
mutation.

It is unclear why the code was written to reuse the same object. There
was no comment, nor is there a commit message providing rationale (it
has behaved this way since the very first commit). Perhaps the objects
were reused to improve performance (fewer object allocations that need
to be garbage collected). I do expect this change to reduce
performance somewhat, but not enough to warrant reverting this commit.
2021-03-29 18:42:55 -04:00
John McLear
2b98b930d7
scaling: include padId in socketio query string 2021-03-24 16:07:11 +00: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
e2bfe2fd10 pad_editor: Promisify init() 2021-03-20 01:07:16 +00:00
Richard Hansen
81e36cf3c7 Ace2Inner: Promisify init() 2021-03-20 01:07:16 +00:00
Richard Hansen
742a7cd430 cssmanager: Throw if no matching style sheet is found
This avoids a later null dereference when the stack trace isn't as
useful.
2021-03-20 01:07:16 +00:00
Richard Hansen
5b05ee79ff cssmanager: Simplify iteration over style sheets 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
webzwo0i
6f591b5c77
add class pad to timeslider to fix height issue (#4941) 2021-03-12 21:16:22 -05:00
webzwo0i
8e2a21ec84
arrow functions dont have arguments (#4943) 2021-03-12 14:25:14 -05:00
Richard Hansen
926f0fcefb CSS: Increase size of contenteditable area 2021-03-08 14:39:18 +00: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
60da2373a6 CSS: Add comment to no-skin/pad.css to silence warning
Firefox prints "Style sheet could not be loaded" if the file is empty.
2021-03-05 07:45:48 +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