Search the web
Sign In
New User? Sign Up
ydn-javascript · Yahoo! User Interface Library Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Problems changing the toolbar to the rich text editor widget   Message List  
Reply | Forward Message #52110 of 52237 |
Re: Problems changing the toolbar to the rich text editor widget

Hi Matt,

I've tried that but with no luck. Here is my code exactly as it appears.

$(function() {

var myconfig = {
height: '300px',
dompath: true,
focusAtStart: true,
buttons: [
{ group: 'fontstyle', label: 'Text formatting',
buttons: [
{ type: 'push', label: 'Ctrl + Shift + B',
value: 'bold' },
{ type: 'push', label: 'Italic CTRL + SHIFT +
I', value: 'italic' },
{ type: 'push', label: 'Underline CTRL + SHIFT +
U', value: 'underline' },
{ type: 'push', label: 'Subscript', value:
'subscript', disabled: true },
{ type: 'push', label: 'Superscript', value:
'superscript', disabled: true },
{ type: 'color', label: 'Font Color', value:
'forecolor', disabled: true },
{ type: 'color', label: 'Background Color',
value: 'backcolor', disabled: true },
{ type: 'color', label: 'Background Color',
value: 'backcolor', disabled: true }
]
},
{ type: 'separator' },
{ group: 'parastyle', label: 'Paragraph Style',
buttons: [
{ type: 'select', label: 'Normal', value: 'heading',
disabled: true,
menu: [
{ text: 'Normal', value: 'none', checked:
true },
{ text: 'Header 1', value: 'h1' },
{ text: 'Header 2', value: 'h2' },
{ text: 'Header 3', value: 'h3' },
{ text: 'Header 4', value: 'h4' },
{ text: 'Header 5', value: 'h5' },
{ text: 'Header 6', value: 'h6' }
]
}
]
},
{ type: 'separator' },
{ group: 'indentlist', label: 'Indenting and Lists',
buttons: [
{ type: 'push', label: 'Indent', value:
'indent', disabled: true },
{ type: 'push', label: 'Outdent', value:
'outdent', disabled: true },
{ type: 'push', label: 'Create an Unordered
List', value: 'insertunorderedlist' },
{ type: 'push', label: 'Create an Ordered List',
value: 'insertorderedlist' }
]
}
]
};
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event;

YAHOO.log('Create the Editor..', 'info', 'example');
var myEditor = new YAHOO.widget.SimpleEditor('editor',
myconfig);
myEditor.render();

});


Here is my html (the textarea part anyway)

<div class="yui-skin-sam">
<textarea name="editor" id="editor" cols="50" rows="10">

</textarea>
</div>


--- In ydn-javascript@yahoogroups.com, "Matt" <matt@...> wrote:
>
> As you've pasted your code, myconfig doesn't exist when you start the
editor and render() it - you only define myconfig afterwards. So the
editor's not going to know anything about the changes you want to make.
>
> Put the var myconfig = ... before the call to
> > var myEditor = new YAHOO.widget.SimpleEditor('editor', myconfig);
> > myEditor.render();
>
> and it should work.
>
> Matt
>
> --- In ydn-javascript@yahoogroups.com, "totalharmonicdistortion"
totalharmonicdistortion@ wrote:
> >
> > Hi,
> >
> > I'm not sure if this is the right place to be posting but here it
goes
> > anyway. I'm happy to move this elsewhere.
> >
> > I'm trying to change the toolbar buttons on the editor widget and I
> > can't seem to get it working.
> >
> > I'm creating the widget like this. Nothing fancy.
> >
> > The toolbar is always rendering the same no matter what I change the
> > button config too. Am I missing a step?
> >
> > Thank you.
> >
> >
> > var myEditor = new YAHOO.widget.SimpleEditor('editor', myconfig);
> > myEditor.render();
> >
> >
> > var myconfig = {
> > height: '300px',
> > dompath: true,
> > focusAtStart: true,
> > buttons: [
> > { group: 'fontstyle', label: 'Text formatting',
> > buttons: [
> > { type: 'push', label: 'Ctrl + Shift + B',
> > value: 'bold' },
> > { type: 'push', label: 'Italic CTRL + SHIFT
+
> > I', value: 'italic' },
> > { type: 'push', label: 'Underline CTRL +
SHIFT +
> > U', value: 'underline' },
> > { type: 'push', label: 'Subscript', value:
> > 'subscript', disabled: true },
> > { type: 'push', label: 'Superscript',
value:
> > 'superscript', disabled: true },
> > { type: 'color', label: 'Font Color',
value:
> > 'forecolor', disabled: true },
> > { type: 'color', label: 'Background Color',
> > value: 'backcolor', disabled: true },
> > { type: 'color', label: 'Background Color',
> > value: 'backcolor', disabled: true }
> > ]
> > },
> > { type: 'separator' },
> > { group: 'parastyle', label: 'Paragraph Style',
> > buttons: [
> > { type: 'select', label: 'Normal', value:
'heading',
> > disabled: true,
> > menu: [
> > { text: 'Normal', value: 'none',
checked:
> > true },
> > { text: 'Header 1', value: 'h1' },
> > { text: 'Header 2', value: 'h2' },
> > { text: 'Header 3', value: 'h3' },
> > { text: 'Header 4', value: 'h4' },
> > { text: 'Header 5', value: 'h5' },
> > { text: 'Header 6', value: 'h6' }
> > ]
> > }
> > ]
> > },
> > { type: 'separator' },
> > { group: 'indentlist', label: 'Indenting and
Lists',
> > buttons: [
> > { type: 'push', label: 'Indent', value:
> > 'indent', disabled: true },
> > { type: 'push', label: 'Outdent', value:
> > 'outdent', disabled: true },
> > { type: 'push', label: 'Create an Unordered
> > List', value: 'insertunorderedlist' },
> > { type: 'push', label: 'Create an Ordered
List',
> > value: 'insertorderedlist' }
> > ]
> > }
> > ]};
> >
>





Sat Nov 7, 2009 12:17 pm

totalharmoni...
Offline Offline
Send Email Send Email

Forward
Message #52110 of 52237 |
Expand Messages Author Sort by Date

Hi, I'm not sure if this is the right place to be posting but here it goes anyway. I'm happy to move this elsewhere. I'm trying to change the toolbar buttons...
totalharmonicdistortion
totalharmoni...
Offline Send Email
Nov 7, 2009
11:23 am

As you've pasted your code, myconfig doesn't exist when you start the editor and render() it - you only define myconfig afterwards. So the editor's not going...
Matt
mattatlamplight
Offline Send Email
Nov 7, 2009
11:38 am

Hi Matt, I've tried that but with no luck. Here is my code exactly as it appears. $(function() { var myconfig = { height: '300px', dompath: true, focusAtStart:...
totalharmonicdistortion
totalharmoni...
Offline Send Email
Nov 7, 2009
12:18 pm

The buttons object needs to belong to the toolbar object, not the Editor's config: http://gist.github.com/215317 Dav ... -- Dav Glass davglass@... ...
Dav Glass
dav.glass
Offline Send Email
Nov 7, 2009
7:19 pm

Hi Dav, It seems the documentation is wrong. I was going off these examples http://developer.yahoo.com/yui/examples/editor/toolbar_editor.html Thanks for your...
totalharmonicdistortion
totalharmoni...
Offline Send Email
Nov 8, 2009
12:18 am

Maybe not documented well enough, but not incorrect. That example shows the default Toolbar config, not an Editor config. The Toolbar config is passed in the...
Dav Glass
dav.glass
Offline Send Email
Nov 8, 2009
1:00 am

Appologies, I read the documentation the wrong way. Thanks again. ________________________________ From: Dav Glass <davglass@...> To:...
Vince Panuccio
totalharmoni...
Offline Send Email
Nov 8, 2009
12:31 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help