0

I am trying to add image cropping functionality into TinyMCE editors used for inline elements (editor appears after focus some inline element and is hidden after focus out, there are more edited areas on page).

Problem is I am not sure if it is good approach, my plan is to add some custom buttons in toolbar and handle them to init jCrop plugin for image used in editor and for confirm selected area to crop.

It seems jCrop basicly works fine in editor, but some problems occurred eg. when user initiate jCrop and then leave that editor and open another editor, it causes jCrop hang on image but withou toolbar.

For fix that I am looking for some callbacks functions of tinyMCE esspec. for event after focus some editable area and blur that one to ensure I can destroy jCrop if necessary, but I cant find that functions.

Is there any way how to set callback function like below?

tinymce.init({
    selector: "div.edit", 
    inline: true,
    setup: function (editor) {},
    ...
    // some methods like this
    onBlur: function (editor) {},
    onFocus: function (editor) {}

});

Appreciate any help or advice, thx, Jan.

4

2 回答 2

0

对于那些仍在寻找关于如何在 TINYMCE4 中设置 BLUR 事件或其他事件的答案的人,这里有一个简短的演示:

tinymce.init({
        selector: "some_selector",
        ...some next attribs ...
        setup : function(ed) { 
            ed.on('blur', function(args) { 
                alert('blur'); 
            }); 
        }
});

当然,除了“模糊”事件之外,您还可以设置 TineMCE4 API 文档中描述的任何其他事件

于 2013-10-10T18:07:50.377 回答
0

好吧,因为这可能是要解决的严重问题,所以我通过购买 Moxie 管理器的许可证来解决这个问题,该管理器具有裁剪功能以及内置的下一个过滤器和功能......

于 2013-10-10T17:42:18.533 回答