Report an issue
Class

CKEDITOR.plugins.lineutils.finder

class private

A utility that traverses the DOM tree and discovers elements (relations) matching user-defined lookups.

Filtering

Properties

Methods

  • since 4.3.0

    constructor( editor, def ) → finder

    Creates a Finder class instance.

    Parameters

    editor : editor

    Editor instance that the Finder belongs to.

    def : Object

    Finder's definition.

    Returns

    finder
  • getRange( location ) → range

    Returns a range representing the relation, according to its element and type.

    Parameters

    location : Object

    Location containing a unique identifier and type.

    Returns

    range

    Range representing the relation.

  • greedySearch() → Object

    Unlike traverseSearch, it collects all elements from editable's DOM tree and runs lookups for every one of them, collecting relations.

    Returns

    Object

    relations.

  • pixelSearch( el, [ x ], [ y ] )

    Iterates vertically pixel-by-pixel within a given element starting from given coordinates, searching for elements in the neighborhood. Once an element is found it is processed by traverseSearch.

    Parameters

    el : element

    Element which is the starting point.

    [ x ] : Number

    Horizontal mouse coordinate relative to the viewport.

    [ y ] : Number

    Vertical mouse coordinate relative to the viewport.

  • start( [ callback ] )

    Initializes searching for elements with every mousemove event fired. To stop searching use stop.

    Parameters

    [ callback ] : Function

    Function executed on every iteration.

  • stop()

    Stops observing mouse events attached by start.

  • store( el, type )

    Stores given relation in a relations object. Processes the relation to normalize and avoid duplicates.

    Parameters

    el : element

    Element of the relation.

    type : Number

    Relation, one of CKEDITOR.LINEUTILS_AFTER, CKEDITOR.LINEUTILS_BEFORE, CKEDITOR.LINEUTILS_INSIDE.

  • traverseSearch( el )

    Traverses the DOM tree towards root, checking all ancestors with lookup rules, avoiding duplicates. Stores positive relations in the relations object.

    Parameters

    el : element

    Element which is the starting point.