History

global. History

Creates a History Object which stores HistoryKeyframes.

Constructor:
  • arg0_keyframes_obj: Object - Map of keyframes.
  • arg1_options: Object
    • .components_obj: Object
    • .draw_keyframes_function: function(arg0_history:this, { components_obj:Object, key:string, value:Array})
    • .localisation_function: function(arg0_history:this, arg1_new_keyframe:HistoryKeyframe, arg2_old_keyframe:HistoryKeyframe) | string - Localisation function to generate descriptions per keyframe.
Instance:
  • .do_not_draw=false: boolean
  • .keyframes: Object - Map of keyframes.
  • .options: Object
Methods:
  • _getUniqueKeyframes(arg0_options:Object) | Array<string>
  • _hasTimestampAfter(arg0_timestamp:Object) | boolean
  • addKeyframe(arg0_date:Object, ...argn_arguments) | HistoryKeyframe
  • callFunctionInDateRange(arg0_date_range:Array<number>|Array<Object>, arg1_function:function(arg0_local_keyframe:HistoryKeyframe))
  • cleanKeyframes()
  • draw(arg0_interface_obj:ve.Interface) | ve.Interface
  • fromJSON(arg0_json:Object|string)
  • getFirstKeyframe() | HistoryKeyframe
  • getLastKeyframe() | HistoryKeyframe
  • getKeyframe(arg0_options:Object) | HistoryKeyframe
  • getTimestamps() | Array<number>
  • moveKeyframe(arg0_date:Object, arg1_new_date:Object)
  • removeKeyframe(arg0_date:Object)
  • replaceKeyframe(arg0_date:Object, ...argn_arguments:any) | HistoryKeyframe
  • toJSON() | string

Constructor

new History()

Source:

Extends

Members

Methods

addKeyframe(arg0_date, …argn_arguments) → {HistoryKeyframe}

Adds a keyframe at the given timestamp with data fields.

  • Method of: History
Source:
Parameters:
Name Type Attributes Description
arg0_date number | Object
argn_arguments any <repeatable>
Returns:
Type:
HistoryKeyframe

callFunctionInDateRange(arg0_date_range, arg1_function)

Calls a function within a given Date range.

  • Method of: History
Source:
Parameters:
Name Type Description
arg0_date_range Array.<number> | Array.<Object>
arg1_function function

(arg0_local_keyframe:HistoryKeyframe)

cleanKeyframes()

Cleans keyframes within the given History object.

  • Method of: History
Source:

close(arg0_mode)

Closes any open UI currently associated with ve.Class, either its class (static) or instance.

Overrides:
Source:
Parameters:
Name Type Description
arg0_mode string

Either 'class'/'instance'.

draw(arg0_interface_objopt) → {ve.Interface}

Draws the current History interface and places the end component in this.interface.

  • Method of: History
Overrides:
Source:
Parameters:
Name Type Attributes Description
arg0_interface_obj ve.Interface <optional>
Returns:
Type:
ve.Interface

fromJSON(arg0_json)

Initialises a History timeline from JSON.

  • Method of: History
Source:
Parameters:
Name Type Description
arg0_json Object | string

getFirstKeyframe() → {HistoryKeyframe|undefined}

Returns the first keyframe in .keyframes.

  • Method of: History
Source:
Returns:
Type:
HistoryKeyframe | undefined

getKeyframe(arg0_optionsopt) → {Object}

Resolves a keyframe at the given date.

  • Method of: History
Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
bake_keyframes boolean <optional>
false
date number | Object <optional>
main.date
guaranteed_indexes Array.<number> <optional>
refresh_localisation boolean <optional>
false
Returns:
Type:
Object

getLastKeyframe() → {HistoryKeyframe|undefined}

Returns the last keyframe in .keyframes.

  • Method of: History
Source:
Returns:
Type:
HistoryKeyframe | undefined

getState() → {Object}

Returns the values of all bound ve.Components as a destructured object.

Overrides:
Source:
Returns:
Type:
Object

getTimestamps() → {Array.<string>}

Sorts and returns all timestamp keys in chronological order.

  • Method of: History
Source:
Returns:
Type:
Array.<string>

isClosed(arg0_mode) → {boolean}

Whether the bound UI for the current mode is closed.

Overrides:
Source:
Parameters:
Name Type Description
arg0_mode string

Either 'class'/'instance'.

Returns:
Type:
boolean

isOpen(arg0_mode) → {boolean}

Whether the bound UI for the current mode is open.

Overrides:
Source:
Parameters:
Name Type Description
arg0_mode string

Either 'class'/'instance'.

Returns:
Type:
boolean

moveKeyframe(arg0_date, arg1_date)

Moves a keyframe from one date to another.

  • Method of: History
Source:
Parameters:
Name Type Description
arg0_date number | Object

The date to move from.

arg1_date number | Object

The date to move to.

open(arg0_modeopt, arg1_optionsopt)

Opens the relevant ve.Window or other Feature responsible for containing either class or instance variables.

Overrides:
Source:
Parameters:
Name Type Attributes Default Description
arg0_mode string <optional>
"instance"

Whether the UI is bound to 'class'/'instance'. If 'class', it displays all static Vercengen fields.

arg1_options Object <optional>
Name Type Attributes Default Description
do_not_close_if_open boolean <optional>
false

Whether to close the Window already bound to class_window or instance_window

name string <optional>
type string <optional>
"window"

Either 'static'/'window'. 'static' by default if .anchor/.x/.y are specified.

anchor string <optional>
"top_left"

Either 'bottom_left'/'bottom_right'/'top_left'/'top_right'. If neither this nor .x/.y are defined, the UI is spawned at the cursor position.

height number | string <optional>
width number | string <optional>
x number | string <optional>
HTML.mouse_x

Mouse coordinates if undefined.

y number | string <optional>
HTML.mouse_y

Mouse coordinates if undefined.

removeKeyframe(arg0_date)

Prunes a keyframe at the specified date.

  • Method of: History
Source:
Parameters:
Name Type Description
arg0_date number | Object

replaceKeyframe(arg0_keyframe, arg1_keyframe, arg2_optionsopt)

Replaces a keyframe at the specified date with another.

  • Method of: History
Source:
Parameters:
Name Type Attributes Description
arg0_keyframe HistoryKeyframe
arg1_keyframe HistoryKeyframe
arg2_options Object <optional>
Name Type Attributes Default Description
refresh_localisation boolean <optional>
false

toJSON() → {Object}

Outputs the current History as a JSON string.

  • Method of: History
Source:
Returns:
Type:
Object

updateOwner() → {Object}

Updates the .owner/.owners field(s) for any attached ve.Components to the current ve.Class.

Overrides:
Source:
Returns:
Type:
Object