yuku / textcomplete

Autocomplete for HTMLTextAreaElement and more.
https://yuku.takahashi.coffee/textcomplete/
MIT License
1.74k stars 303 forks source link

Integration with CKEditor / TinyMCE #285

Closed namaljayathunga closed 8 years ago

namaljayathunga commented 8 years ago

I tried to integrate jquery-textcomplete with ckeditor, then I got this error. TypeError: CKEDITOR.instances.issue_notes is undefined Can you guise give me a little help to accomplish this. I will put the code sample bellow. You can quickly look at this. Thanks.

This is jsfiddle : https://jsfiddle.net/btjapqkp/

amenk commented 8 years ago

Oh my...

When I made the patch, I was integrating it into Redmine (EasyRedmine). Looks like Redmine specific code sneaked into the jquery-textcomplete - this is of course wrong. In this line, it should be the CKEDITOR instance. I can not dig deeper into it at this moment, but maybe that helps you to make a fix?

namaljayathunga commented 8 years ago

Thanks @amenk, It is will be understandable for me if you can edit jsfiddle. Thanks.

amenk commented 8 years ago

I would have to look deeper in it - it is a bug in the textcomplete package - "proudly" introduced by me :'-(

amenk commented 8 years ago

@namaljayathunga Please check my patch

namaljayathunga commented 8 years ago

wow It's working 👍. Thanks @amenk for your quick contributing. However, there is an error when selected text replaced. check this jsfiddle. I'm using latest jquery-textcomplete.

amenk commented 8 years ago

Did you rebuild jquery-textcomplete? In my pull request I changed only the src/ folder - not dist/. Additionally in the fiddle I think you should call textcomplete on the CKEditor textarea first before intialize the CKeditor.

amenk commented 8 years ago

Okay .. It is working, as long as there are not so much other edits on the page: https://jsfiddle.net/btjapqkp/8/ Further PRs are appreciated :)

namaljayathunga commented 8 years ago

Thanks a lot @amenk for dedicate your value time. using ID as a selector, I could use more editor.