Menu

Dj with CK editor (latest)

Help
2014-12-18
2015-01-31
  • benchpresser

    benchpresser - 2014-12-18

    i use latest dj libs, with latest ckeditor.
    problem occurs on ie11 (not tested on ie10 or below) with java 1.7.
    scenario:
    ck editor allows you copy and paste some text. if you copy some text and then right click on the editor, a small window of ck editor appears and has the options paste.

    or another step, you double click some text, and right click mouse, and again we have a small window with options cut, copy, paste.

    if you click on any options on the window, the action gets triggered, for example paste action.

    the problem with dj is, i integrate ck editor with dj browser, i load some html page containing ckeditor.js, then i use navigate with file://..notation. editor works fine, i can type, setcontent, getcontent etc. but problems occur when you right click.

    you see the window, the options but the click events are not invoked.

    i inversitgated the sources of ck, when ck creates a menu(panel),
    the init method of the panel is invoked when used with dj,
    the mouseover on the panel is also invoked when used with dj,
    BUT click events on the panel are not invoked. So paste action for example fails.

    Question: Why are the click events ignored while editing some content on the ckeditor when:
    right clicking and opening the window and selecting some action by click?

     
  • benchpresser

    benchpresser - 2014-12-19

    additional information:
    as i said before, while editing, if you right click, a menu appears with options cut, copy, paste etc. or if you want to modify an image and right click on image, image properties dialog appear. if you click the left mouse button on a manu item, the menu disappears without triggering the action you selected.

    another problem is, if you select one element in toolbar which contains combo, and pick one combo item, again the combo disappears without applying your selectinon. for example, if you want to change font size, you click font button on toolbar (or the arrow of combo), you see the combo menu. if you select a font size, the combo disappears without changing the font. but the other toolbar items without combo work, for exampe bold button, right align etc.

    i checked the source of ck, i looked to the plugins. on the spans or divs, the invoking mechanism is as following:

    onclick=CKEDITOR.tools.callFunction(..) or onmouseup=CKEDITIR.tools.

    onmousedown events are not registered.

    I copied onclick events to onmousedowns by modifyinh js files or applying some query after the editor.html has been loaded. the events now work as expected. but still i have problems with scrollbars, for example if you want to select a large font size 72 for example, you have to scroll down the scrollbar, but if you left click on the scrollbar, the combo menu disappears. mousewheel or keys events work as expected, if you press cursor down or apply mouse wheel and scroll down without clicking the scrollbar, and then select the desired font size, and click on the font size, my manual added mousedown event catches it and it works.

     
  • Christopher Deckers

    Hi,

    So, does it mean this is a bug in CKEditor itself? Or the result of the integration?

    In any case, I am glad you found a workaround, and also that you shared your findings!

    Cheers,
    -Christopher

     
  • benchpresser

    benchpresser - 2014-12-21

    but,

    if you use the editor html containing CK directly in IE or in firefox there is no problem.

    problem occurs if you locate with DJ to the page containing the editor.

    if you pick some item in combo menus, the menu windows gets closed but your picked item is not triggered. The click event is somehow partially consumed.

     
  • Christopher Deckers

    Hi,

    It is possible that focus handling of Java 7+ interfers with the state of click events, but the only way to be sure would be to launch with Java 6, which is not always possible.

    I perform some actions in the code to try to fix focus, maybe you could try to comment that code and see if that lets the legitimate event to run. Relevant code is in SWTNativeComponent, with focus handlers and potentially mouse handlers.

    Hope this helps,
    -Christopher

     
  • benchpresser

    benchpresser - 2015-01-06

    hi

    i solved it with:
    the problem is onblur event, which gets triggered on the ck frame. to solve it i commented out the lines in the plugins:

    ck\plugins\floatpanel\plugin.js

    there must be some code on the lines around 210-220

    focused.on('blur', function(ev) {
    ..
    function doHide() {
    delete this._.returnFocus;

        this.hide();  // comment out this part
    

    with this solution, all panels (both combo and other such as copy paste etc.) remain on the screen, to make them disappear I added some more procedures, finally i have full working dj latest (without any modification on java side) with ck full latest (only plugin.js of floatpanel modified), if anyone interested in the whole part, i can post here.

     

    Last edit: benchpresser 2015-01-06
  • benchpresser

    benchpresser - 2015-01-08

    thank you for the efforts done for focus handling, i will also try changes with the default ck (without my updates) and inform you as soon as possible.

     
  • Christopher Deckers

    Hi,

    Are the changes only located into the CKEditor zip file?

    If there are no changes to DJ Native Swing (or legitimate ones), maybe I could replace the old version I ship with your patched version.

    Cheers,
    -Christopher

     
  • benchpresser

    benchpresser - 2015-01-26

    hi, the changes are only done to the ckeditor files without touching the dj. We have customers using dj + ck editor last two weeks for editing operations. No problems have been reported so far.

     
  • Christopher Deckers

    Hi,

    I think it would be good that I include your version of the ckeditor zip. Would you be so kind as to send it to me, possibly by e-mail so I include it in the preview version?

    I also wonder: shouldn't you report those modifications to the CKEditor developers? They seem to be general purpose fixes.

    Cheers,
    -Christopher

     

Log in to post a comment.