MyBB Community Forums

Full Version: Custom MyCode Button for 1.6
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I added a couple of MyCodes to my board and now I wanna add buttons so that users can actually use them without having to type [function]text[/function]. All the mods I've found are not compatible with 1.6 and were poorly implemented.

Would be awesome if someone can make a mod that does this:

[Image: mybbcustombtns.jpg]


Notice all I want is to extend the toolbar and message window to add two more buttons (unlike other mods which add a new line for custom buttons and break the layout). and be able to customize them.

Thanks in advance.
Or even a second line. I hoped this would be croe 1.6 but it didn't get in.
http://mybbrunway.com/tutorials/adding-b...to-editor/

That should help, Its not a plugin but lets you do what you want to.
It works, but adds the button on top of the others instead of extending the layout and adding after the video button.

Should add the line of your new button after this instead:

{type: 'button', name: 'video', insert: 'video', image: 'television.gif', dropdown: true, title: this.options.lang.title_video, options: this.videos}

Now it follows the video button, but breaks the layout... Any idea how to change the layout?
So I had to remove some buttons in order to make my new ones fit so that the layout won't break, but it looks bad and I would really like to just extend the whole window like in the pictures above. Here's what I have right now (notice how I had to remove the align center and right buttons):

[Image: 19637007.jpg]
Any ideas on how to extend the whole window so everything including my new buttons will fit?
After adding the lines in editor.js you need to increase the size of the text area in the templates wherever the editor is being used. The editor.js automatically calculates the width of the textarea so increasing the text area size will automatically cause editor.js to increase in size and the buttons will then fit

Just keep in mind that you'll have to make the changes in every template where editor is being used, new thread, new reply, edit post and so on.

To change the textarea size, open the template for example for New Thread:

Open New Thread Templates>newthread

Find:
<textarea name="message" id="message" rows="20" cols="70" tabindex="2">{$message}</textarea>

Increase the "cols" to fit the buttons. In my trials, increasing it by 5 makes enough space for one button same size as the media icon. So, to make space for 2 buttons, set it to 80 and so on
(2010-09-27, 05:31 AM)- G33K - Wrote: [ -> ]After adding the lines in editor.js you need to increase the size of the text area in the templates wherever the editor is being used. The editor.js automatically calculates the width of the textarea so increasing the text area size will automatically cause editor.js to increase in size and the buttons will then fit

Just keep in mind that you'll have to make the changes in every template where editor is being used, new thread, new reply, edit post and so on.

To change the textarea size, open the template for example for New Thread:

Open New Thread Templates>newthread

Find:
<textarea name="message" id="message" rows="20" cols="70" tabindex="2">{$message}</textarea>

Increase the "cols" to fit the buttons. In my trials, increasing it by 5 makes enough space for one button same size as the media icon. So, to make space for 2 buttons, set it to 80 and so on

Doesn't work. I tried modifying other settings and they all change stuff, but this setting changes nothing for some reason.
(2010-09-27, 06:18 AM)wigiman Wrote: [ -> ]
(2010-09-27, 05:31 AM)- G33K - Wrote: [ -> ]After adding the lines in editor.js you need to increase the size of the text area in the templates wherever the editor is being used. The editor.js automatically calculates the width of the textarea so increasing the text area size will automatically cause editor.js to increase in size and the buttons will then fit

Just keep in mind that you'll have to make the changes in every template where editor is being used, new thread, new reply, edit post and so on.

To change the textarea size, open the template for example for New Thread:

Open New Thread Templates>newthread

Find:
<textarea name="message" id="message" rows="20" cols="70" tabindex="2">{$message}</textarea>

Increase the "cols" to fit the buttons. In my trials, increasing it by 5 makes enough space for one button same size as the media icon. So, to make space for 2 buttons, set it to 80 and so on

Doesn't work. I tried modifying other settings and they all change stuff, but this setting changes nothing for some reason.
Perhaps the textarea has a style associated in the css for your theme because this works in the default theme confirmed.
You're right. I found the control here it is:

[Image: 15197351.jpg]

Any idea what I need to change/add?
Pages: 1 2