1

I'm developing a workaround for the dreaded bug in WebKit browsers when using a WYSIWYG editor like CKEditor or TinyMCE, where you cannot resize images in a contenteditable region.

FireFox and IE both provide handles for resizing when an image is clicked, but WebKit does not, and I have not seen anybody provide a real workaround for this.

What I have done is set onclick listeners on all images inside the CKEditor instance, which will overlay an absolute positioned DIV directly on top of the image, which has the "jqDnR" plugin, allowing you to resize the DIV. Then there is a resize event on the new DIV which will resize the image that was clicked to 'activate' the overlay.

I'm surprised to say, it actually works! (To an extent)

The problem I'm having is when the image is floated to the right.

The resize handle only pulls to the right. If the image is floated to the right, then you have to drag the handle outside of the CKEditor window, at which point you lose it.

Basically, all I am looking for is a way to "reverse" the jqDnR plugin's functionality for when the image is floated to the right.

All of the 'drag and resize' plugins I've looked at have had the resize handle in the bottom right corner of the element, and you can only drag to the right.

I am open to using something other than jqDnR, but so far it has been the best match and the simplest to work with.

Hope somebody out there has something to say about this.

Thanks!

jqDnR: http://dev.iceburg.net/jquery/jqDnR/

Also, this simple fix is needed for jQuery > 1.1 : jqDnR plugin doesn't work with jQuery 1.4

Community
  • 1
  • 1
ikaufm32
  • 11
  • 3
  • I ended up ditching jqDnR for jqueryUI resizable. It allows you to pass in which "handles" to show. So I made it only show "n, e, s, ne, se" for floatLeft and "n, s, w, sw, nw" for floatRight. It allows the handle to be dragged from right to left instead. This project is on an internal company server but I plan to keep developing this into a CKEditor plugin and making it public. – ikaufm32 Dec 30 '11 at 23:04

0 Answers0