Skip to content

Instantly share code, notes, and snippets.

Created August 27, 2016 12:04
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
JavaScript. CKEditor plugin init codes. - example : Cy-GistInsert's plugin.js
CKEDITOR.plugins.add( 'Cy-GistInsert', {
icons: 'Cy-GistInsert',
init: function( editor ) {
editor.addCommand( 'cmd-insertgist1', { // adding the command
exec: function( editor ) {
editor.insertHtml( 'Test from plugin Cy-GistInsert cmd-insertgist1 ' ); // at now just testing purpose.
editor.ui.addButton( 'Cy-GistInsert', {
label: 'Insert GitHub Gist', // button's tooltip text.
command: 'cmd-insertgist1', // the command to be executed when the button is clicked.
toolbar: 'insert' // toolbar groub into which the button will be added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment