<commit_before># Time Machine

Pushstate history and ajax helper for fancy websites. It handles:

- State change detection
- Replacing the URL
- Loading the new page via ajax
- Binding `<a>` tags to push state rather than navigate
- Highlighting the correct new navigation item
- Replacing the page title

Navigation highlighting and page titles are done using html `data-` attributes on the ajaxed content. See below for an example.

If a browser doesn't support pushState, Time Machine won't start up and the site will work normally.

## Current dependencies

- [History.js Native](https://github.com/browserstate/history.js)
- [Eventie](https://github.com/desandro/eventie)
- [Ajax.js](https://github.com/honza/ajax.js)

## Example usage

Site frame:

```html
<ul id="nav-primary">
	<li data-tm-match="rad-page"><a href="rad-page">Rad Page</a></li>
	<li data-tm-match="cool-page"><a href="cool-page">Cool Page</a></li>
	<li data-tm-match="lame-page"><a href="lame-page">Lame Page</a></li><commit_msg>Update readme with new script behaviour<commit_after># Time Machine

Pushstate history and ajax helper for fancy websites. It handles:

- State change detection
- Replacing the URL
- Loading the new page via ajax
- Running any javascript in the new page
- Binding `<a>` tags to push state rather than navigate
- Highlighting the correct new navigation item
- Replacing the page title

Navigation highlighting and page titles are done using html `data-` attributes on the ajaxed content. See below for an example.

If a browser doesn't support pushState, Time Machine won't start up and the site will work normally.

## Current dependencies

- [History.js Native](https://github.com/browserstate/history.js)
- [Eventie](https://github.com/desandro/eventie)
- [Ajax.js](https://github.com/honza/ajax.js)

## Example usage

Site frame:

```html
<ul id="nav-primary">
	<li data-tm-match="rad-page"><a href="rad-page">Rad Page</a></li>
	<li data-tm-match="cool-page"><a href="cool-page">Cool Page</a></li>
	<li data-tm-match="lame-page"><a href="lame-page">Lame Page</a></li>
{'fraction_non_alphanumeric': 0.1316931982633864, 'fraction_numerical': 0.0, 'mean_word_length': 4.530666666666667, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '548560', 'n_tokens_mistral': 657, 'n_tokens_neox': 624, 'n_words': 223}