MyBB Community Forums

Full Version: Tutorial: Adding Extra Function Buttons to the Editor.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
thanks for this nice tutorial Smile
The proble is, that after such editing, when new version of MyBB comes, I will have edit some of these files again... Am I right? Is there better way to add new buttons?


Ok, I found that you don't need to edit other files besides editor.js...

In codebuttons template find
{$editor_language}

Add after:

editor_language["title_xxx"] = 'Test';

Where title_xxx is previously defined title for button.

I've got no idea if it's correct way of doing this, but it seems to work Smile
How would you create a drop down box and how would you create a popup box like, the hyperlink button?
how i can make this in mybb 1.4???

the line to find in the editor.js is lost, i can't find it Sad
The changes in the files functions.php and global.php are the same. For editor.js open the file and search for:
// Create our new text area
Above add:
this.createToolbar('mytoolbar', {
	container: 'bottom',
	items: [
		{type: 'button', name: 'flash', sprite: 'flash', insert: 'flash', title: this.options.lang.title_flash},
		{type: 'button', name: 'video', sprite: 'video', insert: 'video', title: this.options.lang.title_video},
		{type: 'button', name: 'quick', sprite: 'quick', insert: 'quick', title: this.options.lang.title_quick},
		{type: 'button', name: 'stream', sprite: 'stream', insert: 'stream', title: this.options.lang.title_stream}
	]
});
After that open the file jscripts/editor_themes/*theme*/stylesheet.css and add at the end of the file:
.messageEditor .toolbar_button .toolbar_sprite_flash {
	background: url(images/flash.gif) no-repeat;
}
.messageEditor .toolbar_button .toolbar_sprite_video {
	background: url(images/video.gif) no-repeat;
}
.messageEditor .toolbar_button .toolbar_sprite_quick {
	background: url(images/quick.gif) no-repeat;
}
.messageEditor .toolbar_button .toolbar_sprite_stream {
	background: url(images/stream.gif) no-repeat;
}
The graphics for the buttons have to be in the folder jscripts/editor_themes/*theme*/images/.
i have this issue with the edits
Open the file editor.js again and search for:
subtract = 16;
Replace with:
subtract = 40;
thanks men
I just want to report, that doing what it says to edit in global.lang.php you get an error whilst going to download or visiting last post.

Am I doing it wrong or does everyone get this error?
i think you are doing wrong, works perfect to me
Pages: 1 2 3 4 5 6 7