Module: version_history

Children

Description

This module provides the functionality to load the full version history (for privileged users) and export it to tsv.

Function: retrieve_history

Retrieve the version history of an entity and return a table with the history.

retrieve_history(entity)
Arguments:
  • entity (string()) – the entity id with or without version id.

Return HTMLElement:

A table with the version history.

Function: init_load_history_buttons

Initalize the buttons for loading the version history.

The buttons are visible when the entity has only the normal version info attached and the current user has the permissions to retrieve the version history.

The buttons trigger the retrieval of the version history and append the version history to the version info modal.

init_load_history_buttons()

Function: get_history_tsv

Transform the HTML table with the version history to tsv.

get_history_tsv(history_table)
Arguments:
  • history_table (HTMLElement()) – the HTML representation of the version history.

Return string:

the version history as downloadable tsv string, suitable for the href attribute of a link or window.location.

Function: init_export_history_buttons

Initialize the export buttons of entity.

The buttons are only visible when the version history is visible and trigger a download of a tsv file which contains the version history.

The buttons trigger the download of a tsv file with the version history.

init_export_history_buttons([entity])
Arguments:
  • entity (HTMLElement()) – if undefined, the export buttons of all page entities are initialized.

Function: init_restore_version_buttons

Initialize the restore old version buttons of entity.

The buttons are only visible when the user is allowed to update the entity.

The causes a retrieve of the specified version of the entity and then an update that restores that version.

init_restore_version_buttons([entity])
Arguments:
  • entity (HTMLElement()) – if undefined, the export buttons of all page entities are initialized.

Function: proceed_callback

proceed_callback()

Function: cancel_callback

cancel_callback()

Function: init

init()

Member: version_history:

Member: entity:

Member: title:

Member: message:

Member: proceed_text:

Member: remember_my_decision_id: