Skip to content

Instantly share code, notes, and snippets.

@igotit-anything
Created August 27, 2016 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save igotit-anything/60428799952fed751c3d21c2a4d8b0dd to your computer and use it in GitHub Desktop.
Save igotit-anything/60428799952fed751c3d21c2a4d8b0dd to your computer and use it in GitHub Desktop.
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