Código Javascript:
Ver original
CKEDITOR.plugins.add( 'spoiler', { init: function( editor ) { editor.addCommand( 'insertSpoiler', { exec : function( editor ) { // var timestamp = new Date(); // editor.insertHtml( 'The current date and time is: <em>' + timestamp.toString() + '</em>' ); var myEditor = CKEDITOR.instances.thepost; var mySelection = editor.getSelection(); if (CKEDITOR.env.ie) { mySelection.unlock(true); theSelectedText = mySelection.getNative().createRange().text; } else { theSelectedText = mySelection.getNative(); } var FormattedText = '[spoiler]'+theSelectedText+'[/spoiler]'; myEditor.insertHtml(FormattedText); } }); editor.ui.addButton( 'Spoiler', { label: 'Insert Spoiler', command: 'insertSpoiler', icon: this.path + 'images/spoiler.png' } ); } } );
Si alguien tiene nocion con este tema, me serviria demaciado
EDIT: solucionado, gracias y disculpen el thread