Namespace: history

Drupal.history

Methods

(static) fetchTimestamps(nodeIDs, callback)

Fetch "last read" timestamps for the given nodes.

Parameters:
Name Type Description
nodeIDs Array

An array of node IDs.

callback function

A callback that is called after the requested timestamps were fetched.

Source:

(static) getLastRead(nodeID) → {number}

Get the last read timestamp for the given node.

Parameters:
Name Type Description
nodeID number | string

A node ID.

Source:
Returns:

A UNIX timestamp.

Type
number

(static) markAsRead(nodeID)

Marks a node as read, store the last read timestamp client-side.

Parameters:
Name Type Description
nodeID number | string

A node ID.

Source:

(static) needsServerCheck(nodeID, contentTimestamp) → {bool}

Determines whether a server check is necessary.

Any content that is >30 days old never gets a "new" or "updated" indicator. Any content that was published before the oldest known reading also never gets a "new" or "updated" indicator, because it must've been read already.

Parameters:
Name Type Description
nodeID number | string

A node ID.

contentTimestamp number

The time at which some content (e.g. a comment) was published.

Source:
Returns:

Whether a server check is necessary for the given node and its timestamp.

Type
bool