Commit graph

33 commits

Author SHA1 Message Date
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