Hi DanJohnson,
Yes, please refer to example http://www.richtexteditor.com/demo/custom_buttons.aspx. You can find the source code in the download package.
Also, below is the code of this example page.
- <%@ Page Language="c#" %>
-
- <%@ Register TagPrefix="RTE" Namespace="RTE" Assembly="RichTextEditor" %>
-
- <script runat="server">
- protected override void OnInit(EventArgs e)
- {
- base.OnInit(e);
-
- Editor1.ToolbarItems = "{bold,italic,underlinemenu}{forecolor,backcolor,fontname,fontsize}{justifyleft,justifycenter,justifyright,justifyfull}{insertorderedlist,insertunorderedlist,outdent,indent}{insertlink,insertimage,insertblockquote,syntaxhighlighter}{unlink,removeformat}//{mybutton1}";
- }
-
- </script>
-
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>RichTextEditor - Custom buttons</title>
- <link rel="stylesheet" href="../example.css" type="text/css" />
- </head>
- <body>
- <form id="Form1" method="post" runat="server">
-
-
- <script type="text/javascript">
- var loader;
- var editor;
-
- function RichTextEditor_OnCoreLoad(rteloader) {
- loader = rteloader;
-
- var config = loader._config;
- var toolbar = config._toolbartemplate || config.toolbar;
-
- var btnname = "item_" + toolbar + "_" + config.skin + "_" + config.color + "_mybutton1";
- var basetype = "image_" + config.skin + "_" + config.color;
-
- var define = jsml.class_define(btnname, basetype);
- define.constructor(function () {
- this[basetype + "_constructor"]();
- this.set_imagename("openfolder");
- this.set_tooltip("My custom button!");
- });
- define.attach("click", function () {
- if (!editor) return;
-
- alert("You clicked a custom button");
-
- editor.AppendHTML("<hr /> You clicked a custom button");
- });
- }
-
- function RichTextEditor_OnLoad(rteeditor) {
- editor = rteeditor;
- }
- </script>
-
- <h1>
- Add custom buttons</h1>
- <p>
- The Rich Text Editor allows you extend the functions of the editor. You can create
- new custom buttons and add them to the editor's toolbar list.
- </p>
- <p>
- <RTE:Editor runat="server" ID="Editor1" />
- </p>
-
- </form>
- </body>
- </html>
Regards,
Ken