The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
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. |
#2
|
|||
|
|||
![]()
OK, so I edited one of my templates and added the following code
Code:
<button onclick="vB_Editor['{vb:raw editorid}'].insertText('This is a test to insert text');">InsertText</button> Thanks, |
#3
|
|||
|
|||
![]()
Hi,
I suggest you to use the method I've explained here to load the templates function already present in ckeditor. Follow that steps, create the plugin and the files .js that contains the templates you want to use; examples are in default.js files in /clientscript/ckeditor/plugins/templates/templates/ dir Ask if you need help thomas -- mmm reading the problem again, it seems that my solution is too far from what you ask I'm not a js expert, I cannot help you as well |
#4
|
|||
|
|||
![]()
I've the same request!
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|