I haven't tested this on other WYSIWYG text editors, but on TinyMCE it seems that due to how this module handles the translation of the embedded image code and the advanced CSS tool of the TinyMCE module adds the code the css gets stripped out.

Scenario:
1) Upload image.
2) Select image and apply advanced css through the toolbar button, say, a black border.
3) All looks well.
4) Save and the node and the code isn't there (also viewing the HTML code in the editor reveals the code isn't actually "written")

Misc notes:
1) The advanced css editor works fine for all other elements in the node.
2) Using the latest stable TinyMCE release and WYSIWYG release.
3) Also experienced this with older version of the trio of modules/libraries.

Pondering:
Perhaps the solution is in automatically adding a span or div around the embed image code so the changes can be saved?

Comments

Ken Hawkins’s picture

Addendum as it may be helpful: Note that the image aspect still works fine, it's just that the CSS code isn't preserved.

Inspecting the WYSIWYG preview show that the CSS style is actually written to the Only local images are allowed. tag -- and I can't possibly imagine how this module could reasonably preserve that aside from checking for a CSS style and adding it the embed tag somehow, ala:

[[wysiwyg_imageupload:49:css|"border-width: thick; border-style: solid"]]

Here's a sample of what TinyMCE is trying to do:

<img style="border-width: thick; border-style: solid;" _mce_style="border-width: thick; border-style: solid;" src="=/sites/default/files/imagecache/image_300/imageupload/1/imgad-aquarium.jpg" _mce_src="=/sites/default/files/imagecache/image_300/imageupload/1/imgad-aquarium.jpg" alt="50">
EugenMayer’s picture

Category: bug » support
Status: Active » Closed (works as designed)

Thanks for the detailed description. That simply not supported. at all, as the image you see in whe WYSIWYG editor is just a "example", all custom applied classes will be removed during rendering and are not saved in the backend.

If you want to work with special CSS classes, have a look at the styles and there API of WIUI

Ken Hawkins’s picture

I get that it works as designed, and working within that framework isn't an issue for me -- but it's a frequent recurring problem for end users. Figuring as the premise of this module is to make things easier on those wanting to work with the WYSIWYG and images this setup seems counter intuitive to most end users.

So as a developer working with the client and offering them this module while it makes things easier for them to get their image up, they then complain about positioning it.

And it's not just the CSS edits that get thrown out, often simpler things like aligning right get disregarded. -- I'll continue to explore possible solutions and if I find anything workable I'll report back.

One option that occurred to me would be to "freeze" the image for advanced placement that would swap the image upload code in favor of a standard image embed code. Or perhaps a master setting that only places "frozen" images.

Ken Hawkins’s picture

Category: support » task
Status: Closed (works as designed) » Needs work

Reopening as I've had some luck with my method. Let me know if you're intrigued in allowing to insert "frozen" images, and I'll share more on it.

EugenMayer’s picture

I tend to not support to much different "rendering types" due to different possible feature sets and bloat of the code, but maybe you find / found an elegant way to do this.

Go forward :)

EugenMayer’s picture

Whats the status of this. Looks more like a feature request, but lacks a proper description of what to implement and most important, someone to implement it :)

Ken Hawkins’s picture

Version: 6.x-2.8 » 6.x-2.9
Category: task » feature

It's definitely taken on more a feature request nature.

The project I'm working on that needs it has been sidetracked though I hope to get back to it soon.

Where I stopped I had implemented a new check box option at admin/settings/wysiwyg_imageupload to "Use frozen images"
Selecting that would tell the module's JS to not insert the [[wysiwyg_imageupload:49]] but use a normal image tag with the appropriate imagecache preset. Which would in turn allow it to be fully themeable.

But where I got bogged down was linking that control to the Javascript (I'm not much of a coder in that way.)

EugenMayer’s picture

Iam not sure this will be part of wui later, really depends on the implementation. Be sure to use a submodule for this, it is much more likely to be included :)

Thanks for the update