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

Editor: Add spellcheck / proofreading feature #306

Closed
kriskarkoski opened this issue Nov 20, 2015 · 3 comments
Closed

Editor: Add spellcheck / proofreading feature #306

kriskarkoski opened this issue Nov 20, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@kriskarkoski
Copy link
Contributor

Implement the proofreading/spellcheck feature in the Calypso editor.

Here's what it looks like in WP Admin:
screen shot 2015-11-20 at 2 24 34 pm

@kriskarkoski kriskarkoski added this to the Editor: v1.1 milestone Nov 20, 2015
@jeherve
Copy link
Member

jeherve commented Dec 7, 2015

Also requested here:
http://halfelf.org/2015/calypso/

@aduth
Copy link
Contributor

aduth commented Feb 5, 2016

I've spent some time reviewing the technical requirements for integrating After the Deadline (AtD). There are several hurdles to being able to support it in Calypso, which I'll summarize below:

First and foremost, the existing client-side solutions (official TinyMCE plugin) assume that an endpoint will be made available in proxying requests to the AtD service. For WordPress(.com), this is implemented as an admin-ajax.php handler. We could potentially leverage this in Calypso (as we had done in the pre-Calypso editor), but only in production environments (WordPress.com hostname), and not with current nonce restrictions. Options for moving forward include:

  • Update the AtD service to support CORS JavaScript requests to remove the proxy endpoint requirement. This will likely also require AtD to be served over HTTPS to avoid mixed content failures in making AJAX requests from WordPress.com
  • Or... remove nonce checks from admin-ajax.php AtD handlers (seems suspect, should investigate impact)
  • Or... implement a custom proxy endpoint in our Node Express server (with the side-effect of supporting development environment testing)

Further, we must consider support for ignored strings. In WordPress, this is saved as a user attribute. It may be in our interest to continue using this attribute so that ignored strings are preserved between wp-admin and Calypso editor sessions, or consider storing these settings in a local preference store. Options for moving forward:

  • Add AtD_ignored_phrases to /me/settings endpoint response, including option to update setting. Configure the AtD plugin to read from / save to this endpoint using existing wpcom.js integration.
  • Or... configure AtD plugin to use the Calypso-specific preferences store

Next, required dependencies will need to be ported to work in the Calypso environment. Neither the AtD TinyMCE plugin nor the core JavaScript library are designed to work in a CommonJS environment, nor are they made available on npm. If we follow preexisting patterns, we'd likely want to copy/fork these files to Calypso, rewriting specific portions to adhere to our coding standards, remove references to window globals, and export themselves as CommonJS consumable modules.

Lastly, there is likely some minimal restyling effort required to align the appearance of the AtD suggestions popover with Calypso style standards.

@aduth
Copy link
Contributor

aduth commented Feb 18, 2016

CORS support has been added to the AfterTheDeadline service, which should give us a path forward for implementing proofreading support in the Calypso editor without need for a proxy endpoint.

I expect that major revisions will be required for the TinyMCE AtD plugin, particularly around communicating directly with the AtD service (instead of through a proxy endpoint) and in retrieving/persisting user preferences for ignored suggestions.

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

No branches or pull requests

3 participants