Created
June 16, 2009 05:47
-
-
Save mrchrisadams/130554 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this function is called as part of a larger global object literal named NAG. | |
The function is called like so: NAG.add_RTE('comment_comment', '420px', '250px'); | |
add_RTE: function(text_target, rte_width, rte_height) { | |
var Dom = YAHOO.util.Dm, | |
Event = YAHOO.util.Event; | |
//The SimpleEditor config | |
var myConfig = { | |
dompath: true, | |
height: rte_height, | |
width: rte_width, | |
focusAtStart: false, | |
handleSubmit: true, | |
toolbar: { | |
buttons: [ | |
{ group: 'textstyle', label: 'Font Style', | |
buttons: [ | |
{ type: 'push', label: 'Bold', value: 'bold' }, | |
{ type: 'push', label: 'Italic', value: 'italic' }, | |
{ type: 'push', label: 'Underline', value: 'underline' }, | |
] | |
}, | |
{ type: 'separator' }, | |
{ group: 'insertitem', label: 'Insert Item', | |
buttons: [ | |
{ type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: false } | |
] | |
} | |
] | |
} | |
}; | |
myEditor = new YAHOO.widget.Editor(text_target, myConfig); | |
myEditor.render(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment