Class

RevisionTracker (revision-history)

@ckeditor/ckeditor5-revision-history/src/revisiontracker

class

Follows the changes to the editor content and manages creating revisions.

Filtering

Properties

  • adapter : RevisionHistoryAdapter

    An adapter object that should communicate with the data source to fetch or save the revisions data.

    This property is also set through adapter.

  • isDirty : Boolean

    readonly

    Informs if any changes happened since the last time a revision was saved.

  • isLocked : Boolean

    Informs if the most recent revision is locked or not.

    Is true if there are no revisions added (before the editor and the feature are fully initialized).

Methods

  • updateRevision( [ data ] = { [data.name], [data.isLocked] } ) → Revision

    Updates the most recent revision with given data and recent document changes which happened since the last update.

    If the most recent revision is locked, a new revision with given data and document changes is created.

    See revision history guide to learn more about saving and updating revisions.

    Parameters

    [ data ] : Object

    Revision data.

    Properties
    [ data.name ] : String

    Revision name for the updated or created revision. If set, forces data.isLocked to be true.

    [ data.isLocked ] : Boolean

    Whether to lock the revision after it is updated or created.

    Defaults to false

    Returns

    Revision

    Updated or created revision.