Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

How to integrate CanJs in Ckeditor

$
0
0

Is it possible to integrate a javascript framework (in my case CanJs) to be used within a ckeditor plugin? The goal is to reuse my custom canjs components which should be insert via a ckeditor plugin.

My simple ckeditor plugin looks something like this:

  1. CKEDITOR.plugins.add( 'element', {
    icons: 'element',
    init: function( editor ) {
        editor.addCommand( 'insertElement', {
            exec: function( editor ) {
                editor.insertHtml( '<my-element></my-element>' );
            }
        });
        editor.ui.addButton( 'Element', {
            label: 'Insert Element',
            command: 'insertElement',
            toolbar: 'insert'
        });
    }});
and the simple canjs component:
  1. can.Component.extend({
                tag: "my-element",
                template: "<div>Blah</div>"
            });

Adding a my-element element via plugin or within the source code of the ckeditor is not changing the element. Is there a way to achieve this?

The same question at stackoverflow:

http://stackoverflow.com/questions/29941373/how-to-integrate-canjs-in-ckeditor


Viewing all articles
Browse latest Browse all 3491

Trending Articles