1

I'm trying to create a few ckeditor plugins that manipulate the a full html document's formatting (e.g. you push one of the editor's buttons and the selection becomes a callout, or moves to a new column). The CKEditor API isn't cutting it for me, so I'd like to use jquery on the editor's contents within the plugins. Any suggestions?

This is within Drupal using the wysiwyg plugin.

2
  • As long as jQuery is already loaded when the JS from your plugin is evaluating, there should be no problem with doing this. Have you run into difficulties? Commented Nov 9, 2012 at 16:33
  • It keeps coming up as undefined. Commented Nov 9, 2012 at 17:14

1 Answer 1

2

I use JQuery in my plugins all the time and it works just like within a normal javascript file. I suggest that you load your editor in jquery's ready event, that at least makes sure that jquery is loaded.

Something like this should make sure that your plugins can use jquery because it's loaded beforehand.

<script type="text/javascript">
    $(document).ready(function () {
        CKEDITOR.replace( 'MyLittlePonyFanficEditorTextarea' );
    });
</script>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.