Created
August 27, 2016 12:04
-
-
Save igotit-anything/60428799952fed751c3d21c2a4d8b0dd to your computer and use it in GitHub Desktop.
JavaScript. CKEditor plugin init codes. - example : Cy-GistInsert's plugin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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