$('myElement').moorte(options); new MooRTE(options);
Alternative usage:
// a group of elements $$('.myElements').moorte(options); // single, group, or to apply to the page. var myRTE = new MooRTE(options);
If you use only the basic buttons (bold, italic, etc), MooRTE just needs mootools-core.
However, this class was built to take advantage of other scripts. The popup in the "hyperlink" button uses StickyWin, the "Upload Button" uses FancyUpload, etc. Depender.js is used to load in each of these third-party scripts as needed. For many of the buttons, you must include Depender.js and have it setup correctly!
The MooRTE.Elements object can be extended. To create a button (with some standard options, all are optional MooRTE.Elements.extend({ myButton:{ img: 'path/to/myImg.jpg', onLoad: function(){alert("button loaded")}, onClick: function(){alert("Hello World!")}}, source: function(){alert("3..2...1...boom")} }) });
If your function relies on a third party script, it should be included in the onLoad event as follows: 'scripts' may either be a path to your script, or the class name used by Depender (if you know how to set that up). MooRTE.Elements.extend({ myButton:{ onLoad: function(){ MooRTE.Utilities.assetLoader({ scripts: 'StickyWinModalUI', onComplete: function(){ alert("done") } }) } } });
To define a custom toolbar: MooRTE.Elements.extend({ myToolbar:{ text:'edit', onClick:['group',{Toolbar:['bold','underline','italic']}] });
There are many more options, see the docs on the site.
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