Opened 4 years ago

Closed 4 years ago

#14577 closed Task (invalid)

Adding New Item using editor.AddmenuItem

Reported by: eteamin Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

I am using this code to create instance of CKEDITOR and add a new item using editor addmenuitem: <script src="${tg.url('/lib/ckeditor/ckeditor.js')}"></script> <div class="row">

<div class="col-xs-12">

<textarea id="editorlocal">

local

</textarea>

</div>

</div>

<script type="text/javascript">

CKEDITOR.replace('editorlocal', {

scayt_serviceProtocol: 'http',

scayt_serviceHost: '${server_host}', scayt_servicePort: '${server_port}', scayt_servicePath: 'scayt/ssrv.json', scayt_customerId: ,

scayt_srcUrl: '/lib/ckscayt/ckscayt.js', scayt_autoStartup: true

}); CKEDITOR.config.scayt_sLang= 'fa_IR';

var editor = CKEDITOR.instances.editorlocal; var addtodb = 'addtodb'; editor.addCommand(addtodb, { exec: function () {} }); editor.addMenuItem({

label : 'ADD', command : addtodb

});

alert('shit'); editor.contextMenu.addListener( function( element ) {

return {

Add: CKEDITOR.TRISTATE_OFF

};

});

</script> but in the console it says addMenuItem is not a function. I want to know where exactly does this function is ready to be used so i can create the menu item after that point. thank you

Change History (1)

comment:1 Changed 4 years ago by Jakub Ś

Resolution: invalid
Status: newclosed
Version: 4.5.9 (GitHub - master)

Please ask your questions on Stack Overflow. This is a place for reproting CKEditor bugs.

Second - just please have a look at the code in order to find our how and where to use this method:
https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/image2/plugin.js#L98-L106

However in most cases this method is used:
https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/image/plugin.js#L60-L77
https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/link/plugin.js#L117-L170

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy