Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0] Replace AT.js (@mentions) with Tribute.js #8132

Draft
wants to merge 6 commits into
base: release-3.0
Choose a base branch
from

Conversation

dragomano
Copy link
Contributor

@dragomano dragomano commented Mar 10, 2024

The script used to mention users was updated 9 years ago, it would be nice to replace it.

The AT.js developer himself suggests using Tribute.js as a replacement, so I chose one of the latest forks.

Features

  • single script (tribute.js) instead of 2 (jquery.atwho.min.js, jquery.caret.min.js)
  • no dependencies on jQuery
  • there is no need to change the PHP backend code (we only change mentions.js)
  • there is a possibility of fine tuning (see options)

sshot-2

Signed-off-by: Bugo <cheetah@bk.ru>
@live627
Copy link
Contributor

live627 commented Mar 10, 2024

Thanks! (just the emoji isn't enough)

Signed-off-by: Bugo <cheetah@bk.ru>
Signed-off-by: Bugo <cheetah@bk.ru>
Signed-off-by: Bugo <cheetah@bk.ru>
Copy link
Member

@Sesquipedalian Sesquipedalian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely like the idea of updating to a more recent and maintained script.

However, more work needs to be done on this PR in order to make it fully compatible with SCEditor. In particular, the script only works when the editor is in source mode. It doesn't interact at all with the editor when it is in WYSIWYG mode.

Could you get this working with WYSIWYG mode, @dragomano? Once that is done, I will be glad to merge this PR.

@dragomano
Copy link
Contributor Author

If SCEditor is planned to be kept, it would be better to write a separate mentions plugin specifically for it. As it turns out, Tribute.js has issues with support for iframe and WYSIWYG editors.

@dragomano dragomano marked this pull request as draft April 26, 2024 12:08
Signed-off-by: Bugo <cheetah@bk.ru>
Signed-off-by: Bugo <cheetah@bk.ru>
@Sesquipedalian
Copy link
Member

If SCEditor is planned to be kept

It is. If you want to find or create a solution that works with the WYSIWYG editor, that'd be lovely.

@dragomano
Copy link
Contributor Author

The modern solutions have the tendency to abandon BBCode. For example, CKEditor 4 has BBCode addon, and perfect Mentions/ Tags and Emoji addon (3 in 1), but CKEditor 4 reached its End of Life (EOL) in June 2023. And CKEditor 5 doesn't have BBCode addon.

@Sesquipedalian
Copy link
Member

Sesquipedalian commented Apr 27, 2024

Sorry if I wasn't clear. We have no plans to get rid of SCEditor. I meant that if you can find a solution to the problem that tribute.js doesn't work with SCEditor's WYSIWYG mode, that would be great. If that isn't possible, then we'll need to stick with at.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants