Hi, this is the easiest way to add your mycodes to the message toolbar, let's go:
We will need:
- /jscripts/editor.js
- /jscripts/editor_themes/Office_2007/stylesheet.css
Step #1
Go to the editor.js and search for:
Quote:this.options.lang.title_php}
and add a colon after that. You will get something like this:
Quote:this.options.lang.title_php},
Next, add this template line below the entire line:
Code:
{type: 'button', name: 'name', sprite: 'sprite', insert: 'code', title: 'alt text or tittle'}
And fill it with the following:
- name = the name of your personal code (isn't neccesary to be equal as your mybb name in the list)
- sprite = the sprite code (used to modify the css sheet)
- code = the code that will wrap the text. ([i'm talking about this] [/i'm talking about this])
- title = the alt text that will apear if you put the mouse over the picture
for example, to put a spoiler code:
Code:
{type: 'button', name: 'spoiler', sprite: 'spoiler', insert: 'spoiler', title: 'Hide the text in a box'}
Save and upload the file.
Step #2
Open the
stylesheet.css and in the end of the text add these:
Code:
.messageEditor .toolbar_button .toolbar_sprite_spritename {
background: url(images/sprite+ext) no-repeat;
}
and reeplace:
spritename = the sprite name that we defined in the editor code, remember? ( sprite: 'spoiler')
sprite+ext = your sprite plus extension.
And, for the spoiler for example:
Code:
.messageEditor .toolbar_button .toolbar_sprite_spoiler {
background: url(images/spoiler.gif) no-repeat;
}
Save and upload.
Step #3
Well, finally, get your sprite and upload into the folder:
/jscripts/editor_themes/Office_2007/images/
____
Well, with this method, we can get a nicely custom text toolbar, this is my result:
Have fun and enjoy!!