|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--AjxStringUtil
This class provides static methods to perform miscellaneous string-related utility functions.
Defined in AjxStringUtil.js
Author: Ross Dargahi , Roland Schemers , Conrad Damon
Field Summary | |
<static> Object |
_INDENT
|
<static> Object |
_LF
|
<static> Object |
_NO_LIST
Converts a HTML document represented by a DOM tree to text |
<static> Object |
_NON_WHITESPACE
|
<static> Object |
_ORDERED_LIST
|
<static> Object |
_UNORDERED_LIST
|
<static> Object |
BLANK_RE
|
<static> Object |
BRACKET_RE
|
<static> Object |
COLON_RE
|
<static> Object |
COMPRESS_RE
|
<static> Object |
ELLIPSIS
|
<static> Object |
ENCODE_MAP
HTML-encodes a string. |
<static> Object |
HDR_RE
|
<static> Object |
IS_PRINT_CODE
Returns true if the character for the given key is considered printable. |
<static> Object |
LINE_RE
|
<static> Object |
MSG_SEP_RE
|
<static> Object |
PREFIX_RE
|
<static> Object |
SHIFT_CHAR
Returns the character for the given key, taking the shift key into consideration. |
<static> Object |
SIG_RE
|
<static> Object |
SPACE_ENCODE_MAP
HTML-encodes a string. |
<static> Object |
TRIM_RE
Removes white space from the beginning and end of a string, optionally compressing internal white space. |
Constructor Summary | |
AjxStringUtil
()
Does nothing (static class). |
Method Summary | |
<static> Object
|
_linesToSkip(lines, i)
|
<static> Object
|
_nextNonBlankLineIndex(lines, i)
|
<static> Object
|
_traverse(el, text, idx, listType, listLevel, bulletNum, ctxt)
|
<static> Object
|
_trimBlankLines(text, eol)
|
<static> Object
|
calcDIV()
|
<static> Object
|
clip(origString, pixelWidth, className)
Clips a string at "pixelWidth" using using "className" on hidden 'AjxStringUtil._calcDIV'. |
<static> Object
|
convertHtml2Text(domRoot)
|
<static> Object
|
convertToHtml(str)
|
<static> Object
|
diffPoint(str1, str2)
Does a diff between two strings, returning the index of the first differing character. |
<static> Object
|
getTopLevel(text, eol)
Returns a list of chunks of top-level content in a message body. |
<static> Object
|
getUnitsFromSizeString(sizeString)
|
<static> Object
|
htmlEncode(str, includeSpaces)
|
<static> Object
|
htmlEncodeSpace(str)
|
<static> Object
|
isPrintKey(keycode)
|
<static> Object
|
makeString(val)
|
<static> Object
|
nl2br(str)
|
<static> Object
|
regExEscape(str)
|
<static> Object
|
repeat(str, num)
Returns the string repeated the given number of times. |
<static> Object
|
resolve(str, values)
DEPRECATED |
<static> Object
|
shiftChar(keycode, shifted)
|
<static> Object
|
split(str, dels)
Splits a string, ignoring delimiters that are in quotes or parentheses. |
<static> Object
|
trim(str, compress, space)
|
<static> Object
|
urlEncode(str)
URL-encodes a string. |
<static> Object
|
wordWrap(text, len, pre, eol, breakOkay, compress)
Wraps text to the given length and quotes it, breaking on space when possible. |
<static> Object
|
wrap(origString, pixelWidth, className)
Forces a string to wrap at "pixelWidth" using "className" on hidden 'AjxStringUtil._calcDIV'. |
<static> Object
|
xmlAttrDecode(str)
|
<static> Object
|
xmlAttrEncode(str)
|
<static> Object
|
xmlDecode(str)
|
<static> Object
|
xmlEncode(str)
|
Field Detail |
<static> Object _INDENT
<static> Object _LF
<static> Object _NO_LIST
<static> Object _NON_WHITESPACE
<static> Object _ORDERED_LIST
<static> Object _UNORDERED_LIST
<static> Object BLANK_RE
<static> Object BRACKET_RE
<static> Object COLON_RE
<static> Object COMPRESS_RE
<static> Object ELLIPSIS
<static> Object ENCODE_MAP
<static> Object HDR_RE
<static> Object IS_PRINT_CODE
<static> Object LINE_RE
<static> Object MSG_SEP_RE
<static> Object PREFIX_RE
<static> Object SHIFT_CHAR
<static> Object SIG_RE
<static> Object SPACE_ENCODE_MAP
<static> Object TRIM_RE
TODO: add left/right options
Constructor Detail |
AjxStringUtil()
Method Detail |
<static> Object _linesToSkip(lines, i)
<static> Object _nextNonBlankLineIndex(lines, i)
<static> Object _traverse(el, text, idx, listType, listLevel, bulletNum, ctxt)
<static> Object _trimBlankLines(text, eol)
<static> Object calcDIV()
<static> Object clip(origString, pixelWidth, className)
<static> Object convertHtml2Text(domRoot)
<static> Object convertToHtml(str)
<static> Object diffPoint(str1, str2)
str1
- a string
str2
- another string
<static> Object getTopLevel(text, eol)
text
- a message body
eol
- the eol sequence, defaults to '\n'
<static> Object getUnitsFromSizeString(sizeString)
<static> Object htmlEncode(str, includeSpaces)
<static> Object htmlEncodeSpace(str)
<static> Object isPrintKey(keycode)
<static> Object makeString(val)
<static> Object nl2br(str)
<static> Object regExEscape(str)
<static> Object repeat(str, num)
str
- a string
num
- number of times to repeat the string
<static> Object resolve(str, values)
str
- the string to resolve
values
- an array of values to interpolate
<static> Object shiftChar(keycode, shifted)
<static> Object split(str, dels)
TODO: handle escaped quotes
str
- the string to split
dels
- an optional string of delimiter characters
<static> Object trim(str, compress, space)
<static> Object urlEncode(str)
str
- the string to encode
<static> Object wordWrap(text, len, pre, eol, breakOkay, compress)
text
- the text to be wrapped
len
- the desired line length of the wrapped text, defaults to 80
pre
- an optional string to prepend to each line (useful for quoting)
eol
- the eol sequence for each wrapped line, defaults to '\n'
breakOkay
- whether long words (longer than len
) can be broken, default is false
compress
- remove single returns within a paragraph before wrapping
<static> Object wrap(origString, pixelWidth, className)
<static> Object xmlAttrDecode(str)
<static> Object xmlAttrEncode(str)
<static> Object xmlDecode(str)
<static> Object xmlEncode(str)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |