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
I just left the language file out now. It works perfect. You don't need to edit global.lang.php to everyone, it isn't a requirement =]
i had a js error in MSIE "name empty or not supported by object", when the appropriate title variable was missing... but it's all good, i got my perfectly customised editor now.. i could watch that thing for hours Big Grin
[attachment=11411]
Being that I'm building a community site for a non-profit organization and their members won't need the PHP and Code buttons but will want to embed YouTube videos, I simply changed the PHP lines in the relevant files, uploaded the youtube.gif graphic and commented out the Code line in the editor.

Cheers,
Gene
(2008-08-12, 12:29 PM)Michael83 Wrote: [ -> ]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/.

Thanks, for the update...
FYI:
This thread needs to contain the word codebuttons, so it will show up when searching.


/ Is anyone else surprised that this thread did not ever have a single mention of the word codebuttons? Confused
sisnt work with MyBB 1.4.4
(2008-08-12, 12:29 PM)Michael83 Wrote: [ -> ]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/.
oh thanks this works for me
wait my editor soon
Best Regards
does this work with mybb 1.4
Great and nice
hey i cant find the appedn child in editor.js
does this work for 1.4?
Can anyone update this tutorial to 1.4.4?
^^ yes that would be good.
Pages: 1 2 3 4 5 6 7