Skip to content

Writing HTML attribute to pad span #643

Closed
@scanferla

Description

@scanferla

Hi,

I want to display a tooltip with the author's name when a user mouses over a span. I've noticed that Etherpad Lite already writes a dynamic class that determines the background color of a text span.
Each user has it's own dynamic class with it's own different background color.

The question is: How can I programmatically write another attribute to this user's span?

For instance, we already have:
<span class="author-a-z87zz75zz77zyz66zz73z8z80zdz67zvsz81z2ek">Hello world!</span>

But I want to do this:
<span author-name="Gustavo Scanferla" class="author-a-z87zz75zz77zyz66zz73z8z80zdz67zvsz81z2ek">Hello world!</span>

Another alternative I can think of is:

  • Can I get a user name if I know the userId? How? I can already get the ID based on the span class and now I would need to use this ID to find the name but I don't know how...
  • There is a JavaScript object available containing all authors?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions