开发者

CKEditor - add custom event listener and call original

I extended the default image plugin with a checkbox labelled 'Activate Zoom'. If the user checks the box eventually a parameter is added to the image url. Actually this开发者_如何学JAVA happens within the onChange event of the checkbox.

I recognized that every time the url (txtUrl) is changed the images gets reloaded. That's not an problem taken by itself, but it becomes a serious issue as I resize the image by its selected size by rendering the contents in the frontend of the web application. What means: the user always has the original image with its full dimensions (by default it is resized to 1024x768 on upload process actually), and that dimensions are taken by the script for the refresh.

The long and the short of it: I need a way to prevent that behaviour for this single case.

First thought: don't use the change event, instead change the url and add the zoom parameter by submitting the form, i.e. by clicking the ok button.

Second thought: overwrite the original change event handler of the url text field, check if the change is raised by adding the zoom parameter and if not raise the original event handler defined within the image plugin.

Has anyone a clue?


Nevermind, I hooked into the original image plugin so I can't decide within the onchange function of the url text field whether to refresh the preview and resize the image or not.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜