Editor.Walker
Walker for DOM.
defined in: walker.js
Class
- Editor.Walker (range)
Attributes
- this.evaluator {Function} A function executed for every matched node, to check whether it's to be considered into the walk or not.
- this.guard {Function} A function executed for every node the walk pass by to check whether the walk is to be finished.
Methods
- Editor.Walker. blockBoundary (customNodeNames) <static> Whether the to-be-evaluated node is not a block node and does not match given node name map.
- Editor.Walker. bookmark (contentOnly, isReject) <static> Whether the to-be-evaluated node is a bookmark node OR bookmark node inner contents.
- checkBackward () Check all nodes at left, executing the evaluation function.
- checkForward () Check all nodes at right, executing the evaluation function.
- end () Stop walking.
- Editor.Walker. invisible (isReject) <static> Whether the node is invisible in wysiwyg mode.
- lastBackward () Executes a full walk backwards (to the left), until no more nodes are available, returning the last valid node.
- lastForward () Executes a full walk forward (to the right), until no more nodes are available, returning the last valid node.
- next () Retrieves the next node (at right).
- previous () Retrieves the previous node (at left).
- Editor.Walker. whitespaces (isReject) <static> Whether the node is a text node containing only whitespaces characters.
Attributes Detail
-
this.evaluator {Function} A function executed for every matched node, to check whether it's to be considered into the walk or not. If not provided, all matched nodes are considered good. If the function returns "FALSE" the node is ignored.
-
this.guard {Function} A function executed for every node the walk pass by to check whether the walk is to be finished. It's called when both entering and exiting nodes, as well as for the matched nodes. If this function returns "FALSE", the walking ends and no more nodes are evaluated.
Methods Detail
-
Whether the to-be-evaluated node is not a block node and does not match given node name map.
- Parameters
-
- customNodeNames {Object} Given node name map.
- Returns
-
- {Function} Function for evaluation.
-
Whether the to-be-evaluated node is a bookmark node OR bookmark node inner contents.
- Parameters
-
- [ contentOnly ] {Boolean} Whether only test againt the text content of bookmark node instead of the element itself(default).
- [ isReject ] {Boolean} Whether should return 'FALSE' for the bookmark node instead of 'TRUE'(default).
- Returns
-
- {Function} Function for evaluation.
-
checkBackward () view sourceCheck all nodes at left, executing the evaluation function. 是不是 (不能后退了)
- Returns
-
- {Boolean} "FALSE" if the evaluator function returned "FALSE" for any of the matched nodes. Otherwise "TRUE".
-
checkForward () view sourceCheck all nodes at right, executing the evaluation function.
- Returns
-
- {Boolean} "FALSE" if the evaluator function returned "FALSE" for any of the matched nodes. Otherwise "TRUE".
-
end () view sourceStop walking. No more nodes are retrieved if this function gets called.
-
Whether the node is invisible in wysiwyg mode.
- Parameters
-
- isReject
-
lastBackward () view sourceExecutes a full walk backwards (to the left), until no more nodes are available, returning the last valid node.
- Returns
-
- {Boolean} The last node at the left or NULL if no valid nodes are available.
-
lastForward () view sourceExecutes a full walk forward (to the right), until no more nodes are available, returning the last valid node.
- Returns
-
- {Boolean} The last node at the right or NULL if no valid nodes are available.
-
next () view sourceRetrieves the next node (at right).
- Returns
-
- {Boolean} The next node or NULL if no more nodes are available.
-
previous () view sourceRetrieves the previous node (at left).
- Returns
-
- {Boolean} The previous node or NULL if no more nodes are available.
-
Whether the node is a text node containing only whitespaces characters.
- Parameters
-
- [ isReject ] {Boolean}
Classes
- Anim
- Anim.Easing
- Attribute
- Base
- Button
- ComboBox
- ComboBox.LocalDataSource
- ComboBox.RemoteDataSource
- Component
- Component.Container
- Component.Controller
- Component.Manager
- Component.Render
- Component.UIBase
- Component.UIBase.Align
- Component.UIBase.Box
- Component.UIBase.Close
- Component.UIBase.Constrain
- Component.UIBase.ContentBox
- Component.UIBase.Drag
- Component.UIBase.Loading
- Component.UIBase.Mask
- Component.UIBase.Position
- Component.UIBase.Resize
- Component.UIBase.StdMod
- Cookie
- DataLazyload
- DD
- DD.Constrain
- DD.DDM
- DD.Draggable
- DD.DraggableDelegate
- DD.Droppable
- DD.DroppableDelegate
- DD.Proxy
- DD.Scroll
- DOM
- Editor
- Editor.Range
- Editor.Utils
- Editor.Walker
- Event
- Event.Object
- Event.Target
- IO
- IO.XhrObject
- KISSY
- KISSY.Defer
- KISSY.Loader
- KISSY.Loader.Module
- KISSY.Loader.Package
- KISSY.Promise
- Menu
- Menu.FilterMenu
- Menu.Item
- Menu.PopupMenu
- Menu.Separator
- MenuButton
- MenuButton.Option
- MenuButton.Select
- MVC
- MVC.Collection
- MVC.Model
- MVC.Router
- MVC.View
- NodeList
- Overlay
- Overlay.Dialog
- Overlay.Popup
- Resizable
- Tree
- Tree.CheckNode
- Tree.CheckTree
- Tree.Node
- Waterfall
- Waterfall.Loader