Hi guys,

I've got some code working as an implementation of the hook:
hook_wysiwyg_wysiwyg_plugin($editor)

Pretty much this function and the related JS/Plugin code allows integrating the collapse text markup with rich text editors toolbar buttons.
So far, I've got code working for CKEditor, as a quick plugin that opens a dialog to enter each collapsible text fieldset with 3 fields:
Title, body and classes (optional).

This actually makes the insertion of collapsible text sections much more convenient.

For the moment, I've got that working in a custom module, but I was wondering if anyone would be interested in getting the code either integrated in the module or from a sandbox project.
For now, after enabling the module, it will add a button on the wysiwyg profiles for CKEditor to be selected. Once it's activated in the profile, then it will display the button in the Editor's toolbar, which opens a dialog and adds the right code/markup/syntax in the field.

I'm posting this here, since I'm thinking that ultimately, this could be an interesting and unobtrusive feature to be integrated to the collapse_text module.

Could you please let me know if anyone would be interested in this feature?
I would be glad to post the code here and even happier if you could potentially consider including it in module's code dev releases.

I would greatly appreciate your feedback on this issue and particular feature.
Thanks in advance.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

claudinec’s picture

I would definitely be interested in this - this functionality has been requested by a client. I am using collapse_text 7.x-2.4 and wysiwyg 7.x-dev with CKEditor.

DYdave’s picture

Hi claudinec,

Sorry for the slow/late reply but I have been very busy lately, mostly working on some other modules and couldn't find the time to give you an answer. I'm glad to hear I'm not the only one to find this feature interesting or useful.

I've added the module to sandbox: http://drupal.org/sandbox/DYdave/1818438
with all the necessary code so feel free to go ahead and checkout the module [See the version control tab if you need info on the branch and checkout instructions].

Everything should be explained on the project page and the usage of the module should be very straight forward.
Feedback, questions, comments and other contributions would be highly appreciated.

Last note, I'd still be glad to hear if collapse_text maintainers would be interested in adding this feature to the collapse_text module, as mentioned above. That would probably bring more leverage to get more compatibility across wysiwyg libraries (TinyMCE, CKEditor, etc...).

Thanks!

claudinec’s picture

Thanks DYdave, it's working well for us!

proweb.ua’s picture

Thanks!
it works with cke4 ?

claudinec’s picture

I don't know proweb.ua, I was using it with CKEditor 3.6.

DYdave’s picture

Hi claudinec and proweb.ua,

Sorry for this late reply, but I have started checking on that as soon as I received your messages (4 days ago).

Thanks very much proweb.ua for raising this: it brought to my attention the fact that there was work undergoing to provide support for newer versions of CKEditor... I haven't been following these developments that much and wasn't even aware that CKEditor 4 had a stable release.

Thanks very much claudinec for getting back to proweb.ua on that, I really appreciate your support and feedback.

So pretty much, the reason why I haven't replied yet is because I was waiting to see what was going on in:

As soon as I can see some positive feedback and stabilization of #1853550: Ckeditor 4.0 - The version of CKEditor could not be detected., then I will get that tested on Collapse Text Wysiwyg and get back to you with more information, whether:

  • it needs work to fix some issues for compatibility
  • or it's already compatible and doesn't need any additional debugging (personally, I have the feeling it should still be compatible if WYSIWYG support CKEditor 4)

In any case, you can be sure that I am following these issues very closely, went ahead and created an issue in Collapse Text Wysiwyg's tracker: #1890908: Support for CKEditor 4. I invite you to follow this issue so that you can get direct feedback if it is updated (for example, status changed to needs work, if there's any problem, or RTBC if anything is fine).

I would certainly greatly appreciate any of your feedback, testing, debugging, comments or questions on any of these tickets, that would greatly contribute to helping all of us moving forward.

Thanks again to all of you for your interest, time and feedback.
Cheers!

DYdave’s picture

Status: Active » Needs review

Following up with this issue and seeing such interest, I was wondering if you guys would think it could be a good thing or be favorable to adding a link to: Collapse Text Wysiwyg on Collapse Text's project page. Something like:

This module has been further integrated with WYSIWYG to provide support for CKEditor with an additional button to insert collapsible text in content body. For more information, see: Collapse Text Wysiwyg.

I would be glad to hear if maintainers or anybody else would think it would be relevant to let users know about this potentially useful integration.

Any feedback, comments, suggestions, questions or further issues would be greatly appreciated.
Changing status to attempt on getting maintainers' attention.

Thanks again to all for your interest and feedback.

claudinec’s picture

Thanks for the update, DYdave. I'll watch those issues about CKEditor 4 too, and try it out on a local dev environment.

DYdave’s picture

Alright guys!
Seems like #1853550-163: Ckeditor 4.0 - The version of CKEditor could not be detected., pretty much got rolled in, at 9cbb01f.

I haven't been able to test Collapse Text Wysiwyg with CKEditor 4.x yet, but would greatly appreciate some feedback if anyone encounters any issue.

Any comments, feedback, questions, suggestions, issues or patches would be highly appreciated.
In particular, if you could please follow-up with some feedback, reviews and testing at #1890908: Support for CKEditor 4, it would be really great and allow me to update issue's status.

Thanks very much to all in advance.
Cheers!

DYdave’s picture

Hi guys,

Following up with a support request at Collapse Text Wysiwyg, #1963958: Is this module going to end up being a full project, I wanted to get back to this issue and more particularly try to attract project maintainers' attention on this feature request.

Will this module end up being a full project or be rolled into the collapse text module.
The way it seems to be most times is that WYSIWYG support ends up in the input filter module itself.

It seems the Collapse Text Wysiwyg's code has been around for some time (more than 6 months) already, and tested by several users.
Perhaps we could consider having the sandbox integrated/merged to the Collapse Text module.

As an attempt to get the ball rolling, please find attached to this comment a patch against collapse_text-7.x-2.x at 5cd66c9, which merges the code from sandbox Collapse Text Wysiwyg and adds a new feature to the Collapse Text module to provide filter integration with CKEditor.
File attached as: collapse_text-filter-integration-wysiwyg-ckeditor-1793108-10.patch.

The image for the button couldn't be added to the patch, so after applying it, the attached png (button.png) file should be copied and renamed in the folder:
collapse_text/wysiwyg/ckeditor/button.png
(next to the new plugin.js file)

We would greatly appreciate if maintainers could potentially take a little bit of time to give us some feedback on whether this feature request could be acceptable/reasonable.

Feel free to let us know if you would have any questions, comments, objections, recommendations, suggestions or concerns on any aspects of this ticket or the attached patch, I would surely be glad to provide more information, explain in further details or re-roll the patch if necessary.

Any feedback, comments, testing, reviews, questions, suggestions, recommendations or objections would certainly be highly appreciated.
Thanks very much to all in advance.
Cheers!

finedesign’s picture

Will this resolve the issue where CKeditor disappears when Collapse Text is installed? For months now, the body field on every Edit page on a client site disappears because there is some conflict between CKeditor and Collapse Text. The only workaround I have found is to force them to toggle the editor from "Full HTML" to "Filtered HTML" and back.

DYdave’s picture

@finedesign:

Thanks very much for your comment.

Will this resolve the issue where CKeditor disappears when Collapse Text is installed?

I'm afraid that's not really the purpose discussed in this feature request.
Patch from #10 adds a button to the CKEditor toolbar (through the Wysiwyg module hook/plugin system) to be more user friendly for editors when adding Collapse Text module's specific tags, for example: [collapse ....].
Therefore, if the editor is not displaying, such as for the case your described, this feature/patch wouldn't change much anyway.

For months now, the body field on every Edit page on a client site disappears because there is some conflict between CKeditor and Collapse Text.

This sounds like a different issue that I would assume should be posted in the corresponding modules (Collapse Text, Wysiwyg, or CKEditor if that's what you have been using), for the corresponding versions.
Additionally, I would recommend that you try looking in these modules' issue trackers, this might be an issue that could already have been resolved in a dev version or with an existing patch.

I hope I was able to answer your questions, but feel free to let us know if I missed or overlooked anything.
Cheers!

finedesign’s picture

Ok, thanks Dave!

proweb.ua’s picture

Wysiwyg 7.x-2.2+14-dev

CKEditor 4.1.1.5a2a7e3
CKEditor 4.1.0.80c139aa
CKEditor 4.0.3.0eafb700

Collapse Text 7.x-2.4+0-dev + path #10

after click OK, nothing happens
screen

tested in last Opera, Firefox, Chrom and on two different websites and hosting

DYdave’s picture

@proweb.ua

Thanks a lot for reporting this issue.
This has already been well received in #1986878: not work with last CKEditor 4.

Could we potentially keep this discussion/bug/issue out of this ticket?

I think this is not really related with this discussion actually and is more specific to the Collapse Text Wysiwyg module bugs.

I certainly apologize for the delay of a reply on this issue, but I can already reproduce the bug, I have started working on the fixing, but I'm most likely going to need a little bit more time, before I can get back to you on #1986878: not work with last CKEditor 4.

Thanks again very much for your reporting, feedback, testing and very clear screenshots + versions, it is certainly highly appreciated.
Cheers!

DYdave’s picture

Hi guys,

Sorry again for stalling on this for almost two weeks, but since there hasn't been any feedback on the patch from #10, I wanted to wait a bit longer.

In any case, following-up with @proweb.ua's comment in #14 in priority, it seems we were able to find a simple way to get this issue correctly fixed, see: #1986878: not work with last CKEditor 4.

Please find attached to this comment a re-roll of the patch from #10, against collapse_text-7.x-2.x at 5cd66c9 based on collapse_text_wysiwyg-7.x-1.x at 0155863, with the following noticeable changes:

Patch attached as: collapse_text-filter-integration-wysiwyg-ckeditor-1793108-16.patch.

The Collapse Text Wysiwyg CKEditor Toolbar button image hasn't changed and is still the same file from #10.

I have given the patch some more testing and it seems to work as expected and properly integrate the changes from collapse_text_wysiwyg-7.x-1.x at 0155863.

Lastly, as another attempt to try and keep this feature request (and module in general) moving forward, I went ahead and posted a #2000892: [Collapse Text] Request to take over maintainership/co-maintainership which hopefully could perhaps get us a review or answers from module's maintainers.

I would greatly appreciate to have your reviews, support, feedbacks, comments or questions on any of these tickets, feature or support requests.

Please let me know if you would like me to provide more examples or would have more questions, comments, objections, recommendations or concerns on any aspects of this particular implementation or proposed patch, I would surely be delighted to provide more information, explain in more details or re-roll the patch if necessary.

Once again, thank you very much for your feedbacks and reviews on the Collapse Text Wysiwyg module or this issue, it is certainly highly appreciated.

Thanks in advance to all for your comments, testing, feedback and reporting.
Cheers!

ckrina’s picture

It would be great to have this feature on the stable version.

I've tested the #16 patch against the last dev and it applies cleanly, but when I start using it gives me an error. Everything works perfect, but when I save the node it throws me this error:

Warning: simplexml_load_string(): Entity: line 1: parser error : attributes construct error in _collapse_text_process_child_item() (line 522 of .../modules/contrib/collapse_text/collapse_text.module).
Warning: simplexml_load_string(): <collapse collapsed="collapsed" title=""test-title""/> in _collapse_text_process_child_item() (line 522 of .../modules/contrib/collapse_text/collapse_text.module).

Also, the title does not appear and instead of it uses the default title value in the config page.

When I use the button to add the collapse tag, it adds it like this:
Screnshot inside the wysiwyg

  • DYdave committed f388caa on 7.x-2.x
    Issue #1793108 by DYdave: Added filter integration with wysiwyg.
    

  • DYdave committed 9a8da77 on 7.x-2.x
    Issue #1793108 by DYdave: Filter integration improvements:
    Added support...
DYdave’s picture

Alright guys!

After stalling on this for about two years, at last, I went ahead and committed this new feature against collapse_text-7.x-2.x at f388caa and 9a8da77.

This is an improved version of the previous patch (from #16), cleaned up and up-to-date with the Wysiwyg API (#1890908: Support for CKEditor 4), with support for plugin's strings translation (#2179961: Collapse text wysiwyg translation).

I have added the component Wysiwyg to the issue queue, to be able to tag issues specific to this patch and the Wysiwyg integration. This should allow us to keep track of any potential compatibility issues and perhaps future feature requests to have more Wysiwyg editors integrated (TinyMCE, YUI editor, openWYSIWYG, etc...).

Additionally, Collapse Text Wysiwyg's project page and status have been updated to let users know module has been merged with Collapse Text and that no more developments will take place in the sandbox.
Issues submission guidelines have also been updated to try reminding users who would be tempted to post an issue in Collapse Text Wysiwyg's issue tracker that development has moved to Collapse Text's (with component Wysiwyg) and ideally have any new issues related with Wysiwyg integration posted with the Wysiwyg component.

Coming up next:
Following-up with this new feature, there is still some work left, mostly related with documentation, and the most urgent would seem to be updating Project's page (I wanted to work on the documentation anyway, adding screenshots, most likely in another issue), more particularly the part related with the sandbox module:

2013-01-17: There is a sandbox module available called Collapse Text WYSIWYG which may add integration with CKEditor. I don't use a WYSIWYG editor, so have not tested this, and don't know how well it works, but those with WYSIWYG proclivities may be interested.

Consequently, the README.txt file should also be updated to let users know about this new feature and that Wysiwyg Editors plugin contributions would certainly be warmly welcome.
I would assume parts of Collapse Text Wysiwyg's project page could perhaps be re-used for the documentation, or we might be able keep a link to it somewhere, although I would prefer moving its content to a documentation page to prevent any user from further downloading the sandbox module.

For now, I allowed myself to mark this issue as fixed, but feel free to re-open it, or post a new ticket, at any time if you have any further objections with the chosen solution or any of the changes committed at f388caa or 9a8da77 (we would surely be happy to hear your feedback).

Feel free to let us know if you would have any questions, comments, objections, recommendations, suggestions or concerns on any aspects of this feature request or the latest code changes (commits f388caa and 9a8da77), I would surely be glad to provide more information or explain in further details.

Thanks again to everyone who contributed to this feature and module with testing, reporting, feedback and reviews, without which it wouldn't have been possible to get this sandbox module integrated.
Cheers!


@ckrina,
Thank you very much for your comment and testing feedback.
The issue you have reported has actually been a long standing compatibility problem with wysiwyg and collapse_text.
I suggest you take a closer look at the issue queue and in particular at:
#2557339: simplexml_load_string parser error when used with wysiwyg, #2487193: Support double quotes in the title attribute or #1958468: simplexml_load_string() parser error.
I believe we will work on tackling this issue in a bug report, in a different ticket.
Thanks again for your interest and feedback.

  • DYdave committed d13aac1 on 7.x-2.x
    Issue #1793108 by DYdave: Quick fix from previous commit: wrong file...

Status: Fixed » Closed (fixed)

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