Class: H_history

H_history

Utility class for managing browser history and hash-based navigation.
Handles hash changes, AJAX navigation, and tab management for single-page applications.
When the hash change, an AJAX call is sent. Replacing the # by ? in the url will return the same display as a full reload replaying the AJAX call (but managed by the core module).
that is useful for search engine indexation. That's why hierachy menu contain links with ? but when you click on it it just change the hash, loading only what is necessary.
As there is also route navigation for document, the history will switch to let the navigator manage forward backward action when it's not an hash change event.
Used as h.libs.history.

new H_history()

history.js, line 26

Methods

staticH_history.change_hash(event, hash)

history.js, line 280
Changes the browser hash from a click event.
Prevents default navigation and updates the hash.
Stores the last link clicked and sets from_link flag.
Name Type Description
event Event The click event.
hash string The new hash value.

staticH_history.detect_hash(event)

history.js, line 47
Handles the hashchange event.
Parses the new hash, manages tab navigation, and triggers AJAX calls as needed.
Supports multi-part hashes for chained AJAX requests.
Launched by init.js.
Name Type Description
event Event The hashchange event.

staticH_history.jump_hash(new_hash)

history.js, line 206
Loads a module via AJAX without modifying history.
Parses the hash and triggers the appropriate AJAX call.
Name Type Description
new_hash string The hash string to process.

staticH_history.set_hash(new_hash, hash_array, force_new_tab)

history.js, line 98
Processes a new hash and triggers the appropriate AJAX call.
Handles tab switching, module loading, and chained hash navigation.
If hash_array is provided, processes each part in sequence.
e.g: #document|id=10 will call document public module with a post id=10
Name Type Default Description
new_hash string The current hash value.
hash_array Array | boolean false optional Remaining hash parts to process.
force_new_tab boolean false optional Force opening in a new tab.