The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#21
|
||||
|
||||
Alright I finally solved my problem after messing around with my Javascript code a bit.
Here is the final result: In my newthread template I added the following javascript (doesn't matter where): HTML Code:
<script type="text/javascript"> // This is to insert text into the Standard Editor function insert(el,ins) { if (el.setSelectionRange){ el.value = el.value.substring(0,el.selectionStart) + ins + el.value.substring(el.selectionStart,el.selectionEnd) + el.value.substring(el.selectionEnd,el.value.length); } else if (document.selection && document.selection.createRange) { el.focus(); var range = document.selection.createRange(); range.text = ins + range.text; } } // This is to insert text into the WYSIWYG Editor function insertText() { var textstring = "This text will be inserted into WYSIWYG"; document.getElementById ("{$editorid}_iframe").contentWindow.document.body.innerHTML = textstring; } </script> Below is the code for the button that will actually be used to input the text, a user presses this button, and the content defined appears in the editor: HTML Code:
<input type="button" value="My Button" onclick="insertText();insert(this.form.{$editorid}_textarea,'This text will be inserted into Standard Editor')">
The only problem I have noticed with this script is that for it to work, you MUST have Wysiwyg editor set to default. If you specify any other editor to load on default, the code won't work unless you switch editors first. I have no clue why this is, but most people I trust will be using WYSIWYG by default anyway, so I don't think it's really that much of an issue. |
#22
|
||||
|
||||
I don't have as many users using the WYSIWYG editor as I do using the standard editor, since it is so easy for them to switch.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|