Cdxed v1.0

A simple RTE for mootools



Details

Author
Stéphane P. Péricat
Current version
v1.0
GitHub
stephanepericat/CdxEd
Downloads
2030
Category
Interface
Tags
Report
GitHub Issues

Releases


Dependencies

  • _self_/_current_:
    • Core
    • Cdxed

How to use

Basic usage

var editor = new CdxEd();

window.addEvent('load', function() {
    editor.render('cdxed-wrapper'); //pass the id of the wrapper for the RTE
});

Select which tools to load

var editor = new CdxEd({
    tools: [CdxTools.Bold, CdxTools.Italic, CdxTools.Underline] //this will only load bold, italic and underline
});

Currently available tools

"CdxTools.Undo": undo,
"CdxTools.Redo": redo,
"CdxTools.Bold": bold, 
"CdxTools.Italic": italic, 
"CdxTools.Underline": underline, 
"CdxTools.StrikeThrough": strikethrough, 
"CdxTools.OList": ordered list, 
"CdxTools.UList": unordered list, 
"CdxTools.JustLeft": justify left, 
"CdxTools.JustCenter": justify center, 
"CdxTools.JustRight": justify right, 
"CdxTools.JustFull": justify full,
"CdxTools.Paragraph": paragraph,
"CdxTools.Indent": indent, 
"CdxTools.Outdent": outdent,
"CdxTools.CreateLink": create link,
"CdxTools.Unlink": remove link,
"CdxTools.InsertImage": insert image,
"CdxTools.FontFamily": font family,
"CdxTools.FontSize": font size.

Create your own custom tools

Create a simple tool

var mysimpleBtn = new CdxTool({command: 'DoSomething', id: 'someid'});

Create a complex tool

var myCustomTool = new Class({
    Extends: CdxTool,

    build: function(self, editor) {
        //overwrite actions here
    }
});

License

The MIT-License

Copyright (c) 2010-2011 Stephane P. Pericat

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Demo

http://sppericat.kodingen.com/demos/cdxed/


Acknowledgments

  • This script is based on ggEdit by Lucian CIOROGA ( http://code.google.com/p/ggedit/ )
  • The Link Tool was inspired by: http://dev.opera.com/articles/view/rich-html-editing-in-the-browser-part-2/
  • The icons are provided by GentleFace : http://www.gentleface.com/free_icon_set.html

Todo

  • Color Picker (coming up soon...)
  • bug fixing
  • bug fixing
  • ... more bug fixing

any ideas / suggestions ? mail me at: codexjs[at]gmail[dot]com


Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus