editing.js is part of Aloha Editor project http://www.alohaeditor.org
Aloha Editor ● JavaScript Content Editing Library
Copyright (c) 2010-2015 Gentics Software GmbH, Vienna, Austria.
Contributors http://www.alohaeditor.org/docs/contributing.html
Aloha Editor ● JavaScript Content Editing Library
Copyright (c) 2010-2015 Gentics Software GmbH, Vienna, Austria.
Contributors http://www.alohaeditor.org/docs/contributing.html
- TODO
-
- formatStyle: in the following case the outer "font-family:
arial" span should be removed. Can be done similar to how
findReusableAncestor() works.
<span style="font-family: arial">
<span style="font-family: times">one</span>
<span style="font-family: helvetica">two<span>
</span> - better handling of the last <br/> in a block and generally of
unrendered whitespace.
For example:
formatting
<p>{some<br/>text<br/>}</p>
will result in
<p>{<b>some<br/>text<br/></b>}</p>
while it should probably be
<p>{<b>some</br>text</b>}<br/></p>
- formatStyle: in the following case the outer "font-family:
Methods
-
attribute()
-
This function is missing documentation.
- TODO
-
- Complete documentation.
-
breakline(boundary, breaker){Array.<Boundary>}
-
Creates a visual line break at the given boundary position.
Name Type Description boundary
Boundary breaker
string -
className()
-
This function is missing documentation.
- TODO
-
- Complete documentation.
-
copy()
-
This function is not yet implemented.
- TODO
-
- to be implemented
-
cut()
-
This function is not yet implemented.
- TODO
-
- to be implemented
-
format(start, end, nodeName, boundaries){Array.<Boundary>}
-
Applies block and inline formattings (eg. 'B', 'I', 'H2' - be sure to use
UPPERCASE node names here) to contents enclosed by start and end
boundary.
Will return updated array of boundaries after the operation.Name Type Description start
Boundary end
Boundary nodeName
string boundaries
Array.<Boundary> -
insert()
-
This function is missing documentation.
- TODO
-
- Complete documentation.
-
remove(start, end){Array.<Boundary>}
-
Removes the content inside the given range.
“If you delete a paragraph-boundary, the result seems to be consistent:
The leftmost block 'wins', and the content of the rightmost block is
included in the leftmost:
<h1>Overskrift</h1><p>[]Text</p>
“If delete is pressed, this is the result:
<h1>Overskrift[]Text</h1>”
-- http://dev.opera.com/articles/view/rich-html-editing-in-the-browser-part-1
TODO:
put at beginning and end position in order to preserve spaces at
these locations when deleting.Name Type Description start
Boundary end
Boundary -
style(styleName, opts){Array.<Boundary>}
-
Ensures the contents between start and end are wrapped by elements
that have a given CSS style set. Returns the updated boundaries.Name Type Description styleName
a CSS style name Please note that not-inherited styles currently may (or may not) cause undesirable results. See also Html.isStyleInherited(). The underline style can't be unformatted inside a non-clearable ancestor ("text-decoration: none" doesn't do anything as the underline will be drawn by the ancestor). opts
all options supported by wrapElem() as well as the following: createWrapper - a function that takes a style value and returns a new empty wrapper node that has the style value applied. isPrunable - a function that returns true if a given node, after some style was removed from it, can be removed entirely. That's usually the case if the given node is equivalent to an empty wrapper. isStyleEqual - a function that returns true if two given style values are equal. TODO currently we just use strict equals by default, but we should implement for each supported style it's own equals function. -
unformat()
-
This function is missing documentation.
- TODO
-
- Complete documentation.
-
wrap()
-
This function is missing documentation.
- TODO
-
- Complete documentation.