Download & Extend

Support for Gallery module (g2image)

Project:WYMeditor
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Firstly, thanks for a great new editor. I use this in preference to TinyMCE now.

I'd like to get the image chooser (g2image) of the gallery module (integrates Gallery2 into drupal) working with WYMEditor. I've already added TinyMCE and Standalone support to gallery.module.

I have been able to change the image_dialog to pull up g2image so that's the first step. However, g2image relies on a textarea to insert its information back into the page. WYMEditor removes this textarea and replaces it with an iframe. I'm unable to figure out how to get the g2image info back into the page (without modifying g2image which is not my code).

For more details of g2image please see http://g2image.steffensenfamily.com and http://www.galleryembedded.com/forums/viewtopic.php?t=2765.

Thanks for any help you can provide.

Comments

#1

You have to call 'image_sendValue()' (located in dialog.js) on submit to send the infos back to WYMeditor.
This function takes the image information from 'input' tags, which IDs are :

  • image_title
  • image_alt
  • image_width
  • image_height
  • image_id

In the default image dialog, only Title and Alt texts can be modified by the user, the others are computed.
Hope this helps you a little bit !

Feel free to email me what you've done, so that I can help you further.

Regards.
Moxide

#2

Thanks. I notice now that v0.3 of WYMEditor will use textareas and it is due out in April. Maybe I'll wait for that version before trying to add gallery support.

#3

This should be easy to add to g2image. For tinymce, I can test against window.TinyMCE. Is there an equivalent that I could test for?

Example

if (window.wymeditor)
[load the dialog.js script into the dynamically produced HTML for the page]

if (window.wymeditor)
image_sendValue(html)

If there is a value like that, it's easy to add a test for it and use the correct method for posting the html from g2image back into the editor window.

nobody click here