Skip to content

Instantly share code, notes, and snippets.

@mrchrisadams
Created June 16, 2009 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrchrisadams/130554 to your computer and use it in GitHub Desktop.
Save mrchrisadams/130554 to your computer and use it in GitHub Desktop.
// 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