-
Notifications
You must be signed in to change notification settings - Fork 1
A simple WYSIWYM editor for mootools
SilverTab/nawte
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
nawte 0.4 ========= Nawte stands for "Not a WYSIWYG editor". By that I mean that you will not see text transformation/formatting etc. as you would in a regular WYSIWYG editor (which are usually tied to one specific language). Nawte was made with one goal in mind: to be as simple as possible, and to let you do what you need with it. Nawte itself isn't tied to any language. You can use it with html, markup, BBCode, textile, wiki markup or any other markup language you can think of. How does it work? ================= Well it's quite simple actually, nawte ties itself to a textarea, then it gives you a set of functions (and, most importantly; it gives you the possibility to add your own functions), so that you can transform the textbox into a simple editor. The very base of the concept is the "addFunction" method. When you add a new function to nawte (for example let's say you add the "bold" function), nawte will add a bold button just above your textbox, and perform the text modification that you want it to perform. It's as simple as that, but with nawte's helper functions and simplicity, it allows you to do pretty much anything you want.... Available Functions =================== This is just a list of all functions/methods with a brief description. Note that a full documentation can be found here: http://www.silverscripting.com/nawte/Docs/files/nawte-0-3-js.html The documentation is for version 0.3, but so far 0.4 only adds compatibility with mootools 1.2 so 0.3's doc is still useful. nawte() ------- The constructor... takes a textarea, an unordered list and a set of options... onchange() ---------- nawte dispatches a change event when a button was clicked or when text was pasted into it (which a regular textbox won't do). addFunction() ------------- The core of nawte. With this function you add your own custon functionality like "Bold" or "Italic" or "Link to:" etc. anything you can think of, you can probably do it. You will use "text-transform" methods in your functions (described below)... getSelection() -------------- This function returns the textbox's currently selected text. wrapSelection(text) ------------------- Wraps the textbox's selection with "text". insert(before/after, text) -------------------------- Inserts text before or after the selection. replaceSelection(text) ---------------------- Replaces the current selection with "text". processEachLines(callback) -------------------------- Will process each lines of the selection with "callback". More information ================ More info (deployment etc..) can be found at nawte's webpage: http://www.silverscripting.com/nawte License ======= Nawte is released under the MIT license: http://www.opensource.org/licenses/mit-license.php Author ====== Nawte was coded by Jean-Nicolas Jolivet (www.silverscripting.com). Based on a prototype script called Control.Textarea.
About
A simple WYSIWYM editor for mootools
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published