| 169 | | |
| 170 | | /* |
| 171 | | TODO: Find a solution to the "repetition of history" problem for manually re-entered hashes. |
| 172 | | FIXME: There is a possible fail state, if a person manually re-enters a previously existing hash it will be appended to the end of the history, but the stack pointer will be adjusted to the first time it appeared in the history stack. This creates a state where you've come to the page "fresh" but are loading the old state. |
| 173 | | |
| 174 | | PARTIAL SOLUTION: Watch for changes in window.history.length. Compare these to the initial length when arriving at the page and the number of items on the site's stack. |
| 175 | | |
| 176 | | Success Scenarios: |
| 177 | | 1. A manually re-entered hash that matches the current one won't trigger an event or change the length (click location bar, press enter, no change). |
| 178 | | 2. A manually re-entered hash that doesn't match the current hash changes window.history.length, and is catchable. |
| 179 | | |
| 180 | | Fail Scenarios: |
| 181 | | 1. The user is exactly one spot deep in the browser history stack. The length does not change because it pops all future events off the stack and adds a new one immediately. |
| 182 | | */ |
| 183 | | |