noosfero | Tinymce links (#709)

Daniela Feitosa gitlab at gitlab.com
Tue Oct 20 08:33:35 BRST 2015


New comment for Merge Request 709

https://gitlab.com/noosfero/noosfero/merge_requests/709#note_2442321


Daniela Feitosa

This plugin is generating its own tinymce (lines [56](https://gitlab.com/noosfero/noosfero/blob/master/plugins/environment_notification/public/environment_notification_plugin.js#L56) and [87](https://gitlab.com/noosfero/noosfero/blob/master/plugins/environment_notification/public/environment_notification_plugin.js#L87)) instead of using the same of [tinymce on core](https://gitlab.com/noosfero/noosfero/blob/master/app/helpers/tinymce_helper.rb#L49)

To use the one from core, you should add the class `mceEditor` on the textarea you want, like [this example](https://gitlab.com/noosfero/noosfero/blob/master/app/views/cms/_blog.html.erb#L56). Noosfero will add the tinymce in all textareas with this class.

To use the same as the used on core, that already [treats the documentBaseUrl](https://gitlab.com/noosfero/noosfero/blob/master/app/helpers/tinymce_helper.rb#L14), you sould:
* remove the initialization of tinymce from plugin (lines [56](https://gitlab.com/noosfero/noosfero/blob/master/plugins/environment_notification/public/environment_notification_plugin.js#L56) and [87](https://gitlab.com/noosfero/noosfero/blob/master/plugins/environment_notification/public/environment_notification_plugin.js#L87))
* add class mceEditor on [textarea](https://gitlab.com/noosfero/noosfero/blob/master/plugins/environment_notification/views/environment_notification_plugin_admin/_form.html.erb#L2)
* as you need a tinymce with only four buttons, you could add a new mode ("restrict", for example) that includes only the 4 buttons you need. The buttons are included on [tinymce_helper](https://gitlab.com/noosfero/noosfero/blob/master/app/helpers/tinymce_helper.rb#L23)
* also, you could include a test to make sure it works :)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151020/7e00f41a/attachment.html>


More information about the Noosfero-dev mailing list