Tutorial: Adding Extra Function Buttons to the Editor.
#21
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 =]
[Image: logo2ue.png]
Reply
#22
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
   
[Image: 350x19.jpg][Image: tstargermany.png]
Reply
#23
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


Attached Files Thumbnail(s)
   
“The road to positivity is strewn with the abandoned vehicles of the faint-hearted.” Peter McWilliams
Reply
#24
(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
#
MyBB is the best forum software! Exclamation

Reply
#25
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
Reply
#26
does this work with mybb 1.4
Reply
#27
Great and nice
Reply
#28
hey i cant find the appedn child in editor.js
does this work for 1.4?
Reply
#29
Can anyone update this tutorial to 1.4.4?
Image too tall

Apparently 92% of teens listens on to rap music.
If you are part of the 92% that listen to rap, then put this in your signature!
Rap and HipHop FTW!
Reply
#30
^^ yes that would be good.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)