Skip to content

Add wysiwyg support#6

Merged
jjeaton merged 5 commits into
plugin-structurefrom
add-wysiwyg-support
Jul 4, 2017
Merged

Add wysiwyg support#6
jjeaton merged 5 commits into
plugin-structurefrom
add-wysiwyg-support

Conversation

@JasonHoffmann

Copy link
Copy Markdown
Contributor

Ok, this adds WYSIWYG support in a basic way.

It uses the global defaults of the content field to initiate tinyMCE instead of a custom setup, but it gets us a good amount of the way there.

In order for it to work generally, each group that's created is given a separate name, then a hidden field is added to capture that name and piece it all together during sanitization.

Also cleans up some styles.

@jtsternberg

Copy link
Copy Markdown

Just a comment, as I know this sortof the v1 or whatever, but not all post-types will have the content field as a registered support, so in those cases, you wouldn't have the global default available.

@JasonHoffmann

Copy link
Copy Markdown
Contributor Author

Yea it will definitely need to be amended before this is even truly beta. I want to step through and pull it from the WP hook dynamically, but this was a good first step.

@jjeaton jjeaton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code LGTM, is this up on staging? I wasn't able to see the wysiwyg working there.

@JasonHoffmann

Copy link
Copy Markdown
Contributor Author

@jjeaton never pushed it to staging. It's up in the image group now.

@jjeaton jjeaton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Autosave appears to be broken on the staging site. I see "error when saving" in the bottom right of the editor when I'm creating a new page.

$prefix was undefined in the twentyseventeen/functions.php but even after fixing that the autosave isn't working.

} );
}

cmb_flexible.setWysiwygRow = function( $el ) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A comment explaining why this is required would be helpful here. 🌴 I'll still merge though.

@jjeaton

jjeaton commented Jul 4, 2017

Copy link
Copy Markdown
Contributor

I wasn't able to reproduce the "error while saving" issue locally. I'm going to merge this, and we can come back to fix anything later.

@jjeaton jjeaton merged commit 498ae0c into plugin-structure Jul 4, 2017
@JasonHoffmann JasonHoffmann deleted the add-wysiwyg-support branch July 5, 2017 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants