Commit graph

1786 commits

Author SHA1 Message Date
Richard Hansen
0dc66e629e collab_client: Rename function for consistency 2021-09-10 01:54:40 -04:00
Richard Hansen
f26cc7f707 collab_client: Delete unnecessary getSocket() helper 2021-09-10 01:54:40 -04:00
Richard Hansen
f564e72792 collab_client: Replace valuesArray() function with Object.values() 2021-09-10 01:54:40 -04:00
Richard Hansen
0c95f2e65e collab_client: Delete unused options argument 2021-09-10 01:54:40 -04:00
Richard Hansen
8ef84e5350 pad: Fix initialization race condition
Ensure that `padeditbar.init()` is called before setting up
`pad.collabClient` to avoid the following exception when there is an
error connecting:

    TypeError: Cannot read property 'length' of undefined
        at Object.toggleDropDown
        at Object.showModal
        at Object.disconnected
        at r.<anonymous>
        at r.emit
        at r.onevent
        at r.onpacket
        at r.<anonymous>
        at r.emit
        at r.ondecoded
2021-09-10 01:54:26 -04:00
Richard Hansen
a18f5de0fc collab_client: Defer sending messages until connected
This avoids filling the server logs with "Dropping pre-CLIENT_READY
message" error messages.
2021-09-10 01:48:41 -04:00
Richard Hansen
1ff228391d collab_client: Set CONNECTED after sending CLIENT_READY
This makes it possible to defer actions until after the CLIENT_READY
message is sent to the server.
2021-09-10 01:48:41 -04:00
Richard Hansen
05f6e196ae collab_client: Set CONNECTED from pad.js 2021-09-10 01:48:41 -04:00
Richard Hansen
966ba54874 collab_client: Promisify deferred actions 2021-09-10 01:48:40 -04:00
Richard Hansen
5814b76aa4 collab_client: Delete unused deferred action tag 2021-09-10 01:48:40 -04:00
Richard Hansen
67e7a822e8 collab_client: Treat RECONNECTING the same as CONNECTING 2021-09-10 01:48:40 -04:00
Richard Hansen
02ae7f5c36 collab_client: Always run deferred actions on connect 2021-09-10 01:48:40 -04:00
Richard Hansen
54a746ce94 collab_client: Fix connection timeout logic 2021-09-10 01:48:40 -04:00
Richard Hansen
60dde4edf6 collab_client: Defer on any non-CONNECTED state 2021-09-10 01:48:40 -04:00
Richard Hansen
3f7745b48b collab_client: Invert condition to improve readability 2021-09-10 01:48:40 -04:00
Richard Hansen
7dbd278d1d deps: Bump js-cookie to 3.0.0 2021-08-29 23:36:48 -04:00
Richard Hansen
0d65dc8a44 pad: Add clientVars to postAceInit hook context
This allows plugins to avoid the `clientVars` global variable.
2021-08-25 14:59:17 -04:00
Richard Hansen
fed950e809 ace2_inner: Simplify handler for Ctrl-@ (show authors) 2021-08-16 00:34:30 -04:00
Richard Hansen
88057eade2 ace2_inner: Readability improvements 2021-08-16 00:34:30 -04:00
Richard Hansen
bc6428025a ace2_inner: Use for..of iteration to improve readability 2021-08-16 00:34:30 -04:00
Richard Hansen
f06307cb4c ace2_inner: Fix for..in iteration
See commit c38c34bef4.
2021-08-16 00:34:30 -04:00
Richard Hansen
2d50a8aa95 ace2_inner: Fix efficiency of rangeForLine()
Returning `true` or `false` has no effect when iterating using
`Array.prototype.forEach`. This fixes a bug introduced in commit
b28bfe8e31.
2021-08-16 00:34:30 -04:00
Richard Hansen
ca2e008e7b ace2_inner: Move variable declarations to appropriate scope 2021-08-16 00:34:30 -04:00
Richard Hansen
bf10e70f2e ace2_inner: Delete unnecessary currentLine variable 2021-08-16 00:34:30 -04:00
Richard Hansen
9fc613d362 ace2_inner: Delete unnecessary checks 2021-08-16 00:34:30 -04:00
Richard Hansen
a5f9c60a34 ace2_inner: Operate on Elements, not Nodes 2021-08-16 00:34:30 -04:00
Richard Hansen
aad75e4661 ace2_inner: Factor out duplicate line number div creation 2021-08-16 00:34:30 -04:00
Richard Hansen
3237f8d123 ace2_inner: Simplify iteration over line number divs 2021-08-16 00:34:30 -04:00
Richard Hansen
b238d9610a ace2_inner: Factor out duplicate line height application 2021-08-16 00:34:30 -04:00
Richard Hansen
1b890e3d4d ace2_inner: Replace lineNumbersShown with number of children 2021-08-16 00:34:30 -04:00
Richard Hansen
27363bf729 ace2_inner: Add line number divs directly, not via fragment
There's no layout thrashing so the fragment doesn't provide any
benefit.
2021-08-16 00:34:30 -04:00
Richard Hansen
e1a024847c ace2_inner: Delete unnecessary innerdocbody variable 2021-08-16 00:34:30 -04:00
Richard Hansen
7d807d2fc5 ace2_inner: Delete unnecessary container variable 2021-08-16 00:34:30 -04:00
Richard Hansen
4b4584c264 ace2_inner: Delete unnecessary doc and root variables 2021-08-16 00:34:25 -04:00
Richard Hansen
ec63c15a40 ace2_inner: Simplify document body selection 2021-08-16 00:31:09 -04:00
Richard Hansen
11c86e677a ace2_inner: Consistently use outerWin and outerDoc 2021-08-16 00:31:09 -04:00
Richard Hansen
98c1ba5808 ace2_inner: Use destructuring assignment to simplify 2021-08-16 00:31:09 -04:00
Richard Hansen
c7be4f9d2d ace2_inner: Move sidedivinner creation to ace.js 2021-08-16 00:31:09 -04:00
Richard Hansen
15b1d4cb75 ace2_inner: Build sidedivinner programmatically 2021-08-16 00:31:09 -04:00
Richard Hansen
b80295c228 ace2_inner: Combine declaration and initialization 2021-08-16 00:31:09 -04:00
Richard Hansen
7a8edc816b ace2_inner: Replace initLineNumbers() with an IIFE 2021-08-16 00:31:09 -04:00
Richard Hansen
b5bfff43cf ace2_inner: Delete redundant class assignment 2021-08-16 00:31:08 -04:00
Richard Hansen
e581ee01f2 ace2_inner: Formatting improvements 2021-08-16 00:30:50 -04:00
Richard Hansen
0ca5a3459f Timeslider: Install an error handler 2021-08-14 07:44:05 -04:00
Richard Hansen
b6fba9d66d Pad: Improve page load error handler
* Install the error handler early.
  * Include stack trace.
  * Remove unnecessary escaping.
  * Improve formatting.
  * Move to a separate script file.
2021-08-14 07:44:05 -04:00
Richard Hansen
4a1f21ce34 pad_editbar: Convert snake case to camel case 2021-08-14 07:26:31 -04:00
Richard Hansen
5478d2ce60 pad_editbar: Use ES6 class syntax for readability 2021-08-14 07:26:31 -04:00
Richard Hansen
97ccf9e082 pad_editbar: Factor out duplicate code 2021-08-14 07:08:57 -04:00
Richard Hansen
ee41de4809 pad_editbar: Deprecate the toggleDropDown callback 2021-08-14 07:08:57 -04:00
Richard Hansen
c629ee09a8 pad_editbar: Call the callback asynchronously
This follows JavaScript best practices.
2021-08-14 07:08:57 -04:00