ClassicPress / ClassicPress-v2

NOT READY FOR PRODUCTION.
GNU General Public License v2.0
13 stars 4 forks source link

Tinymce in text widget #275

Closed KTS915 closed 12 months ago

KTS915 commented 1 year ago

This addresses Issue #273.

Description

Adds back scripts that were omitted from ~/wp-includes/script-loader.php. Also adds back code that was previously removed from ~wp-admin/js/widgets/text-widgets.js because the lack of the missing scripts caused the widget otherwise to generate many errors.

Motivation and context

This re-enables the usage of the TinyMCE editor in the text widget.

How has this been tested?

On my localhost test installation.

Screenshots

Before

Screenshot at 2023-10-31 16-53-14

After

Screenshot at 2023-10-31 16-53-58

Types of changes

mattyrob commented 1 year ago

LGTM - tested locally and Text Widgets have TinyMCE restored.

KTS915 commented 1 year ago

I think there's something more to be done for the Customizer; at the moment, if you add two Text widgets there, the second won't open until you refresh the page.

KTS915 commented 1 year ago

Nearly there now, I think! The last patch also fixed the sending of input to the database and refreshing the view in the Customizer.

The remaining issue is that, after adding a Text widget in the Customizer, it's not actually possible to type in the Visual tab: only in the Text tab and the title. After refreshing the page, this works fine.

KTS915 commented 1 year ago

The last patch should have resolved the outstanding issue. I just increased the time for TinyMCE to destroy its previous instance before attempting to create a new one.

xxsimoxx commented 1 year ago

When you expand a text widget it gets out of the column (same behavior in 1.7.1), but when you collapse it keeps the width.

image
KTS915 commented 1 year ago

When you expand a text widget it gets out of the column (same behavior in 1.7.1), but when you collapse it keeps the width.

image

I haven't seen that. Is it in a specific browser?

xxsimoxx commented 1 year ago

It's in Chrome.

KTS915 commented 1 year ago

I can't reproduce that on Chrome on Linux. I'll try another computer with Windows later.

KTS915 commented 1 year ago

I have now reproduced it on Windows (and it's also the case with the Custom HTML widget). It looks like a new margin-left is being added when these widgets are expanded. I will take a look.

KTS915 commented 1 year ago

I've just an !important to a style rule to make sure that the Text and Custom HTML widgets stay within their containers when expanded.

mattyrob commented 12 months ago

Two recent approvals after further browser testing.