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

Desktop: Resolves #3535: Configure tinymce to handle the first table row as header #8163

Merged
merged 4 commits into from Jun 10, 2023

Conversation

marph91
Copy link
Contributor

@marph91 marph91 commented May 11, 2023

Resolves #3535

Consider the first table row as header in the richtext editor automatically. Switching isn't needed anymore. This is based on https://tinymce.github.io/tinymce-demos/tables/customizing-the-table-toolbar.html.

Open questions:

  1. The new menu only contains the table size selection. As far as I see, most of the options are either covered by the table tooltip (insert, delete, properties) or incompatible with markdown (merge and split cells). Only the cut/paste options are missing. I could either try to add the cut/paste options to the tooltip or build the menu manually, as it was before. What would be the preferred way?
  2. There are some any types. I left them for now, since the surrounding code has them, too. Let me know if I should try to fix them.

Screenshot:

Screenshot_20230511_155150

@github-actions
Copy link
Contributor

github-actions bot commented May 11, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@marph91
Copy link
Contributor Author

marph91 commented May 11, 2023

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request May 11, 2023
@laurent22
Copy link
Owner

Thank you, that looks very good. The menu we have at the moment is indeed needlessly complex.

Regarding any, please could you check if you can get the types from TinyMCE? If too complicated, don't worry, but in general for new code we try to set types everywhere

They were removed previously when inserting the custom table.
@marph91
Copy link
Contributor Author

marph91 commented May 17, 2023

I added the missing functions to the table toolbar. Some were removed, because they were non-functional or duplicated. This is how it looks now:

Screenshot_20230516_182656

This allows for example easy copy pasting of rows/columns by only three clicks.

Types should be complete now, too.

Copy link
Owner

@laurent22 laurent22 left a comment

Choose a reason for hiding this comment

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

Just one minor issue and we can merge. Thanks for clearing the "any" types!


// Available table toolbar buttons:
// https://www.tiny.cloud/docs/advanced/available-toolbar-buttons/#tableplugin
const table_toolbar = [
Copy link
Owner

Choose a reason for hiding this comment

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

tableToolbar (see coding_style.md)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fixed now. I guess the TinyMCE parameter name confused me.

Copy link
Owner

@laurent22 laurent22 left a comment

Choose a reason for hiding this comment

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

Just one minor issue and we can merge. Thanks for clearing the "any" types!

@laurent22 laurent22 merged commit 6dc8ad2 into laurent22:dev Jun 10, 2023
8 checks passed
@laurent22
Copy link
Owner

Thanks for implementing this @marph91!

@github-actions github-actions bot locked and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WYSIWYG - Table gets header row added after switching notes
2 participants