Hi,

Here is a revised drupalimage pluggin that makes a separate button for the img_assist module. Currently drupalimage hijacks the tinymce 'add image' button, making it impossible to inline images. I think this module should add to the core functionality of tinymce not override existing functions. This version of drupalimage pluggin along with a minor change in the tinymce.module makes a new button, a camera icon (at the moment), which triggers img_assist. The icon was lifted from the 'slick' icons for KDE and is in the lower right corner of the editor.

Thanks again for a great module,

mitomac

CommentFileSizeAuthor
#1 tinymce.patch332 bytesmitomac
drupalimage.tar.gz4.34 KBmitomac
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mitomac’s picture

FileSize
332 bytes

Here is the patch for the tinymce.module.

mitomac

matt westgate’s picture

Committed to HEAD. Thanks.

Ideally if we could just get the img_assist icon to be aware of when tinymce is running that would be the best solution.

Anonymous’s picture

Having img_assist detect tinymce would be a nice feature, I may try to poke into that. I do have a couple of questions regarding the development of this module. Are you trying to stay away from changes to the tinymce codebase? It just dawned on me that tinymce is actually pretty limited in how it handles images. There is no way (at the moment) to pass all the img_assist options to tinymce. An immediate consequence of this is that inserted images are not anchor linked to their respective node and there is no way to pass captions. Looking at the code and api for tinymce it appears that the original codebase will have to be hacked to accept these options. Also, the theming system leaves a lot to be desired. For example only the advanced theme has hooks to add pluggins or new buttons and yet no way to delete specific buttons. I was able to edit the default theme to include the drupalimage plugin, but this will be over the head of the casual drupal admin. Is anyone working on a fully customizable theme?

mitomac

mitomac’s picture

strike my remarks about the advanced theme, I apparently completely missed [theme_advanced_buttons1] and [theme_advanced_disable]. My bad.

mitomac

Anonymous’s picture

damaikar’s picture

Title: Fix to make a drupalimage a separate button » Re: Fix to make a drupalimage a separate button

Dear mitomac and folks,

Thanks for your work on the TinyMCE Editor... no problem at your end...just a problem at mine...I'm a newbie (don't worry it's not contagious:-P ).

I have installed the drupalimage thing and activated the image_assist module....I don't yet have a 'Photo Icon' appearing beneath the text-box (as per directions from the TinyMce 'INSTALL.TXT file in the Module folder).

I am hoping that my problem lies with the 'tinymce.module' patch that you have almost kindly provided :-P:

"206c206
< $init['extended_valid_elements'] = 'a[href|target|name]';
---
> $init['extended_valid_elements'] = 'a[href|target|name|title|onclick]';
209c209
< $init['theme_advanced_buttons3_add'] = 'emotions,separator,print';
---
> $init['theme_advanced_buttons3_add'] = 'drupalimage,separator,print,emotions';"

I say 'almost' because I have no idea what to do with this patch. I have no idea where to put it in the tinymce.module file. I don't know whether to append, insert or overwrite...I don't know anything about what to do with this no doubt key piece of information.

I don't know if those bits saying '209c209' are line references, part of the code to be included or not.

Some newbie level direction would be appreciated. Something like:

Get this bit of code and without the brackets [example only*******] look for this bit of code [Insert relevant code map/signpost here] in the tinymce.module file and then do this with it.....(eg. Overwrite, Insert, Comment-in, Uncomment etc).

Your more specific guidance will be greatly appreciated.

Regards

StephenG
admin@sgprojx.com.au

metzlerd’s picture

FYI: Should probably post this to the support forum or create a separate issue.

Regarding Patches:
patches are meant to be applied with the Linux/unix "patch" command. I'd recommend looking at a man page on this. That's what I did.

Regarding your problem:
#1 cause of this problem is not completing the installation of Image Assist. There is an image assist plugin that must be copied into the tinymce folder. Then you edit the tinymce profile and add teh image assist button to the toolbar.

The "extra button" outside the editor is controlled in admin/settings/image assist.