• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Adding to the TinyMCE Editor

Jeremy

Well-known member
#1
Hey Kier & Mike (mainly),

I remember you saying somewhere that the TinyMCE editor that you have coded here doesn't allow for custom images / text.... So, if I wanted to add custom BB Codes to them, would I have to extend the controller (I doubt that's possible for the editor) & manually edit the template? Or is there some magical way you guys have hidden from us to add items to the editor?

Thanks,
Jeremy
 

Jeremy

Well-known member
#4
And... to answer this question. If I am correct (I haven't written any code) you can use the template hook for editor_js_init (I believe that is the name) and add a JS line in it for buttons to be added.
 

Jeremy

Well-known member
#6
I have no idea how to add a button to TinyMce. I do not know any JS code is required. :)
If I am correct, you need to add something to editor_js_setup under xenforo: to set up hovers... And then add appropriate CSS. I'm not 100% sure, haven't gotten around to developing tha.t
 

James

Well-known member
#7
TinyMCE is initialised in the editor_js_setup between the hook editor_tinymce_init.

You should be able to plug parameters straight into that from the TinyMCE Reference.

Let me know if you get anywhere.
 
#8
I've added button for custom BB code by copying and modifying code from "quote" button. There are three files must be modified for this task:
editor_template.js ( TinyMCE theme definition )
editor_js_setup
editor_ui.css
and adding new phrase to used languages
I have not any web programming experience, so it's maybe a creepy way, but at least, it works :D
 

mizter1nho

Well-known member
#13
I've added button for custom BB code by copying and modifying code from "quote" button. There are three files must be modified for this task:
editor_template.js ( TinyMCE theme definition )
editor_js_setup
editor_ui.css
and adding new phrase to used languages
I have not any web programming experience, so it's maybe a creepy way, but at least, it works :D
Can you share code? Thank you.
 
#14
This pack contains three txt files which shows code changes. You can find them by arrows at left side.
BTW, editor_template.js changes were applied to a copy of original theme placed in another directory in "js\tinymce\themes\". And this files shows theme changing code too.
 

Attachments

Cool

Active member
#16
this unfortunately is (at least for me) the big minus for xenforo. i personally need a fully working tinymce editor for admins.
 

James

Well-known member
#17
I asked a while back if it'd be possible to edit the editor using TinyMCE code and I believe Mike replied saying it was possible. I cannot find the thread though, and I figured out it wasn't possible too.