I'm not 100% sure how this will go; but since we're going to have a WYSIWYG editor in core with D8 (see #1890502: WYSIWYG: Add CKEditor module to core), it might be nice to make this module work well with that first, and other modules (is Wysiwyg going to exist for D8? Even if it does, it'll probably take a while to port it) after.

Comments

geerlingguy’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Active » Needs work

Okay, working on stuff now. I've opened an 8.x branch, and have the module at least show up on the modules page: http://drupalcode.org/project/wysiwyg_linebreaks.git/commit/e78ad0b

I'm cleaning things up, and will hopefully be able to find a way to listen for the editor module's 'attach' event, and if it's called, and Wysiwyg linebreaks is installed and configured, our JS will be attached and run...

I might need to add a configure page where users can choose whether to force linebreaks or convert linebreaks. And is there a way I could allow setting this per-Wysiwyg editor? I guess I need to explore how editor.module is the same as/different than wysiwyg.

geerlingguy’s picture

Also opened up follow-up issue for 7.x/6.x bugfixes: #2066419: Fix module name and missing variable declaration in linebreaks.js.

geerlingguy’s picture

It works! See: http://drupalcode.org/project/wysiwyg_linebreaks.git/commit/417eacd

Next step is making the conversion from tags back to linebreaks (done when the editor is switched off (like when a node is saved) work correctly (so users can choose whether they want the 'force linebreaks' or 'convert linebreaks' functionality, like in D6/D7.

The usability/architecture is already a jillion times better, since we don't have to provide a button and some extra empty CSS files and such in D8. Nice!

geerlingguy’s picture

The change record CKEditor module added: WYSIWYG in core! was key to completing the module port from D7 to D8, especially the section Provide additional CKEditor plugins.

With the third commit for this issue, I've implemented the settingsForm() method of CKEditorPluginConfigurableInterface, and am using the new configuration setting when the linebreaks.js file is loaded to determine whether to force linebreaks or convert them.

Just need to do another once-over on the D8 branch, and make sure I have everything cleaned up, and then I'll be able to close this issue and release a beta (though it's working great for me and can be stable once D8 is stable). Yay!

geerlingguy’s picture

I just finished the rest of the work in porting the module (updated README.md and removed extraneous files)... but I can't seem to get my pushed commits and new tag (8.x-1.x-beta5) to appear here, even though git is reporting my branches are in sync.

Anyways, a couple more quick things I need to do now:

  1. Update the module's documentation (on project page, and on documentation page(s)?
  2. Update the module's picture, maybe, to better illustrate what it does with CKEditor (since that's what's used in D8).
  3. Get the rest of my commits to show up on drupal.org!

[Edit: Well, davereid found my missing commit by browsing git manually (see: http://drupalcode.org/project/wysiwyg_linebreaks.git/commit/fcaf3dd), but for some reason it seems the synchronization of the git repo to the project page was/is broken?]

geerlingguy’s picture

Posted follow-up issue in the infrastructure queue: #2066525: Pushed git commits and tags are delayed, unable to create release nodes. Hopefully that gets resolved soon!

geerlingguy’s picture

Status: Needs work » Fixed

Because of the problem reported in the previous comment, I had to tag a new release and add that release, so the first beta is beta2 :)

See release node: https://drupal.org/node/2067297

Yay!

wim leers’s picture

#4: happy to see that the change record proved useful to you! :)

So, what was your overall impression of the API provided by ckeditor.module? :)

wim leers’s picture

Also, I'd appreciate it if you could chime in on #1933916-17: [meta] How do we want to facilitate enabling of CKEditor for sites upgraded from Drupal 7 to Drupal 8? :) Thanks for porting!

P.S.: don't hesitate to ping me if you have problems/questions with this module or another WRT editor.module or ckeditor.module in Drupal 8!

geerlingguy’s picture

@Wim Leers: So, so SO much better than working with Wysiwyg plugins in D7. Wysiwyg was an amazing first step in D6/D7 in terms of making a modular Wysiwyg system for Drupal... but focusing on CKEditor (along with editor.module) looks like it's going to make the architecture and pluggability so much simpler.

On the flip side, I found that some of the documentation around editor.module (and especially it's responsibilities vs. ckeditor.module and any other editors that want to work with editor.module) was lacking/unclear. I hope I can help with that here and there, when I get time :)

wim leers’s picture

#10: great! About editor.module docs being lacking. First, I assume you did see/read the corresponding change notice at https://drupal.org/node/1911614. Second, where do you find them lacking? I can definitely inject a paragraph there to explain that editor.module is a light glue module that provides basic infrastructure that any text (WYSIWYG) editor module would need (to attach/detach a text editor, but also integration with Drupal 8's new dialog system), whereas it is up to the modules using the infrastructure provided by editor.module to allow for text (WYSIWYG) editor-specific to do things that are specific to them. Such as ckeditor.module allowing for other modules to provide CKEditor plugins.

Other than that, it might be wise to update that change notice with the changes introduced in #1894644: Unidirectional editor configuration -> filter settings syncing and #1886566: Make WYSIWYG editors available for in-place editing.

How does that sound?

geerlingguy’s picture

That sounds good - I didn't even know https://drupal.org/node/1911614 existed, so that was helpful. (I probably should've searched for 'WYSIWYG' on the change notice page. Silly me!).

geerlingguy’s picture

Title: Port Wysiwyg Linebreaks to Drupal 8 » D8CX: I pledge that Wysiwyg Linebreaks will have a full Drupal 8 release on the day that Drupal 8 is released.
Issue tags: +D8CX

Updating tags and titles.

Automatically closed -- issue fixed for 2 weeks with no activity.