ErnestA
10-05-2011, 03:03 AM
I've got the hang of creating my own custom BBCodes with buttons in CKeditor, but I'm a bit stumped with something else I'm trying to do. I've added a few extra fields input type fields to the editor window which get populated automatically with some vBulletin variables (attachment ids). BBCodes buttons are nice, but all they do is add the opening and closing BBCode tags, the user must manually fill the rest in. What I'd like to do is make a simple javascript button which takes the value of the input field I've created and inserts it into the current cursor position of the editor. Does anyone know where I can find the correct functions and methods to do this with the vBulletin / ckEditor? It's really a simple piece of Javascript code, but a bit challenging when you don't know anything about interfacing to the editor.
I found the following reference on ckEditor's site:
CKEDITOR.instances.editor1.insertText( ' line1 \n\n line2' );
But I can't find where and how vBulletin is creating an instance of the editor and what the instance is named...
Any help is greatly appreciated.
Thanks,
Ernest A.
I found the following reference on ckEditor's site:
CKEDITOR.instances.editor1.insertText( ' line1 \n\n line2' );
But I can't find where and how vBulletin is creating an instance of the editor and what the instance is named...
Any help is greatly appreciated.
Thanks,
Ernest A.