Commit graph

46 commits

Author SHA1 Message Date
Richard Hansen
89fe40e080 Changeset: Migrate from OpIter to deserializeOps() 2021-11-23 01:21:49 -05:00
Richard Hansen
f1eb7a25a6 Changeset: Migrate to the new attribute API 2021-11-21 04:11:41 -05:00
Richard Hansen
1f227200da Replace separate attrib key, value calls with single pair call 2021-11-21 04:11:41 -05:00
Richard Hansen
9e7b142bb7 Invert conditions to improve readability 2021-11-21 04:11:41 -05:00
John McLear
c361df52d2 bugfix: Allow selection to start/end before line marker 2021-10-02 02:41:58 -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
webzwo0i
15dba7d886
move underscore to its old place and remove unnecessary packages (#4876) 2021-02-27 00:10:53 -05:00
John McLear
ce83181ac3
Lgtm bugfixes (#4838)
* code tidy up: always evaluates

* tidy up: is always true

* tidy up: remove unused code

* always true/false variables

* unused variable

* tidy up: remove unused code in caretPosition.js

* for squash: Revert "tidy up: remove unused code in caretPosition.js"

The `if` condition was previously always true, so the body should be
preserved. If the body is preserved, other logic can be deleted. I
opened PR #4845 to clean it all up.

This reverts commit 75b03e5a7dc1ff9a8728ed2341fd9fe970d0615f.

* for squash: simplify

* for squash: Explain that the getter is used for its side effects

It's very weird to call a getter without using its return value. Add a
comment explaining why this is done so that the reader doesn't get
confused.

* for squash: Revert "tidy up: remove unused code"

The exception test was the purpose of the code.

This reverts commit 85153b167613b2513fff99e22b8ded8ea1e4547b.

* for squash: Log the tsort results

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-22 08:26:35 +00:00
John McLear
1b8cd0747d
Move vendor libraries to /vendors folder and exclude from LGTM 2021-02-21 15:07:39 +00:00
John McLear
73b3a2dc54 lint: AttributeManager.js use ES6 method for hasAttrib 2021-02-21 11:05:25 +00:00
John McLear
0897a28e70 lint: AttributeManager 2021-01-29 09:16:50 +00:00
Richard Hansen
462530eafb AttributeManager: Fix attribute name during attribute removal
Before this change, the `author` attribute was silently discarded
during `.map()` iteration and the name of the attribute to remove was
included twice with two different values.
2021-01-29 09:16:50 +00:00
Richard Hansen
8efc87f33a AttributeManager: Fix bogus this during attribute removal
Before this commit, the callback passed to `.map()` during attribute
removal was a normal function, not an arrow function. This meant that
the value of `this` in the function body depended on how the callback
was invoked. In this case, the callback was invoked without any
explicit context (it was not called as a method, nor was it called via
`.call()`, `.apply()`, or `.bind()`). Without any explicit context,
the value of `this` depends on strict mode. Currently the function is
in sloppy mode, so `this` refers to the "global this" object (a.k.a.,
`window`). It doesn't make sense for the callback to reference
`window.author`, so I'm assuming the previous behavior was a bug.

Now the function is an arrow function, so the value of `this` comes
from the enclosing lexical context, which in this case is the
AttributeManager object. I believe that was the original intention.
2021-01-29 09:16:50 +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
Luiza Pagliari
58c3154769
[fix] Ignore default line attribs when detecting edges of changeset (#3420)
When comparing original content with the changes made by the user, we
need to ignore some line attribs that are added by content collector,
otherwise we would consider the change started on the first char of the
line -- the '*' that is added when line has line attribs.

In order to be able to handle both #3354 and #3118, we need to take into
account both the styles attribs (to fix #3354) and the line attribs
defined by any of the plugins (to fix #3118), but we can ignore those
extra line attribs that are added by Etherpad and do not add any
functionality (`'lmkr', 'insertorder', 'start'`).
2018-07-09 17:44:38 -03:00
Joas Souza
454f539561 Select formatting button on selection (#3301)
[feat] Select button when selection is on formatted text
2018-01-04 12:28:00 -02:00
John McLear
282b1cdcfe Merge pull request #2940 from ether/extend-getAttributesOnSelection
extend attributesonselection method
2016-04-05 22:30:15 +01:00
John McLear
4846798528 extend attributesonselection method 2016-03-26 22:00:34 +08:00
Luiza Pagliari
9bcf8690c0 Update author when removing line attribute from line
This avoids raising error 'Trying to submit changes as another author in
changeset' when 2 authors change line attributes of the same line. This
fixes issue #2925.
2016-03-15 15:44:00 -03:00
Luiza Pagliari
330d2b079d Fix 2772. Skipping line marker when applying attribs to a range 2015-09-08 11:55:36 -03:00
John McLear
64a89a3ec0 Merge pull request #2541 from cristo-rabani/patch-3
fixed + support for value
2015-03-31 22:58:10 +01:00
Thomas Muehlichen
a930161cb9 feature #2558 added documentation 2015-03-31 10:58:47 +02:00
Thomas Muehlichen
fbcbc3c8a2 feature #2558 more precise documentation 2015-03-25 13:29:03 +01:00
Thomas Muehlichen
e8d85c1173 feature #2558 added functions to get all attributes at the current or an abritrary position 2015-03-25 12:04:10 +01:00
cristo-rabani
ed3ec96838 own list 2015-03-24 20:04:28 +01:00
cristo-rabani
382804e44c fix 2015-03-22 23:14:17 +01:00
Thomas Muehlichen
a3f07c1048 fixes #2556 (error toggling line attribute) and clarified method documentation (AttributeManager.toggleAttributeOnLine) 2015-03-20 11:58:56 +01:00
Cristo
da1bf00a78 fixed + support for value 2015-03-06 23:02:31 +01:00
Marcel Klehr
751adb24fd Finally fix AttribManager#removeAttributeOnLine
return safely if the attribute wasn't found.
fixes #2394
2015-01-05 18:38:34 +01:00
Marcel Klehr
cfe75c7f3f Clean-up after removing list attribute: Remove list numbering attribute 2014-12-30 17:45:26 +01:00
Marcel Klehr
362315c638 AttribManager#removeAttribOnLine: Remove Linemarker entirely if there's nothing else left 2014-12-28 12:34:42 +01:00
Marcel Klehr
a63880dcb1 Fix AttributeManager#removeAttributeOnLine: Only remove a single attrib 2014-12-27 16:15:20 +01:00
Matthias Bartelmeß
2406800cd6 documentation on AttributeManager 2012-04-08 21:21:05 +02:00
Matthias Bartelmeß
62c9b1c25e Merge branch 'fix/list-removal' into ace2_refactoring 2012-04-07 10:26:21 +02:00
Matthias Bartelmeß
8be1deda6f Merge branch 'develop' into fix/list-removal 2012-04-07 03:42:16 +02:00
Matthias Bartelmeß
18dc111010 Fixing bug where lists get deleted when pressing enter 2012-04-07 03:42:05 +02:00
Matthias Bartelmeß
0340c87996 Pad message handler detects lineattributemakers by asking Attribute manager 2012-04-07 01:05:25 +02:00
Matthias Bartelmeß
39d0b149a9 corrected documentation on Attribute Manager 2012-04-06 17:44:34 +02:00
Matthias Bartelmeß
9b1536ac10 fixing 'rep is not defined' error 2012-04-05 22:26:39 +02:00
Matthias Bartelmeß
5833cb1037 renamed performDocumentApplyAttributesToRange to setAttributesOnRange and moved it to AttributeManager 2012-04-05 15:22:22 +02:00
Matthias Bartelmeß
093b7ab4bf added lineMarkerAttribute + more comments 2012-04-05 15:20:48 +02:00
Matthias Bartelmeß
60942b09a4 fixing lineHasMarker 2012-04-05 01:07:47 +02:00
Matthias Bartelmeß
23cda77b65 added AttributeManager, ChangesetUtils 2012-04-05 00:50:04 +02:00