Skip to content

Commit f7a7a04

Browse files
committed
Updated some readme formatting. Added ajaxify extension link.
1 parent 6c6c8b9 commit f7a7a04

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

README.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Welcome to History.js <br/> v1.8b2, June 22 2013
33

44
[![Flattr this project](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=balupton&url=https://github.com/browserstate/history.js&title=History.js&language=&tags=github&category=software)
55

6+
67
## News
78
- 22/06/2013: Beta 2 of v1.8 is released. Fixes and uncompressed bundled files.
89
- 31/05/2013: Beta 1 of v1.8 is released. Fixes.
@@ -11,14 +12,15 @@ Welcome to History.js <br/> v1.8b2, June 22 2013
1112
- 21/01/2013: Alpha 2 of v1.8 is released. Correct statechange behaviour.
1213
- 19/01/2013: Alpha 1 of v1.8 is released. Started to categorize old balupton's issues.
1314

15+
1416
### History
17+
[See the `History.md` file for a detailed list of features, changes, solved issues and bugs](https://github.com/browserstate/history.js/blob/master/History.md#files)
1518

16-
See the [`History.md`](https://github.com/browserstate/history.js/blob/master/History.md#files) file for a detailed list of features, changes, solved issues and bugs
1719

1820
### Involve
19-
2021
Please create an issue if something doesn't work or if there is a browser specific bug. I'll try to fix it as soon as possible. Please send me your Pull requests if you have a nice solution! I'm also going to review old issues in balupton's repository and try to solve them too.
2122

23+
2224
## Aims
2325

2426
- Follow the [HTML5 History API](https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history) as much as possible
@@ -27,16 +29,21 @@ Please create an issue if something doesn't work or if there is a browser specif
2729
- Provide a forwards-compatible experience for HTML4 States to HTML5 States (so if a hash-fallbacked url is accessed by a HTML5 browser it is naturally transformed into its non-hashed url equivalent)
2830
- Provide support for as many javascript frameworks as possible via adapters; especially [Dojo](http://dojotoolkit.org/), [ExtJS](http://www.sencha.com/), [jQuery](http://jquery.com/), [MooTools](http://mootools.net/), [Right.js](http://rightjs.org/) and [Zepto](http://zeptojs.com/).
2931

30-
## Usage
3132

32-
### Instant
33+
## Quick Install
3334

34-
To ajaxify your entire website with the HTML5 History API, History.js and jQuery the [Ajaxify Script](https://github.com/browserstate/ajaxify) is all you need. It's that easy.
35+
### Via Ajaxify Script
36+
To ajaxify your entire website with the HTML5 History API, History.js and jQuery the [Ajaxify script](https://github.com/browserstate/ajaxify) is all you need. It's that easy.
3537

36-
### Ruby On Rails
38+
### Via Ajaxify Extension
39+
If you don't have access to your server, or just want to try out the Ajaxify script first, you can install the [History.js It! Google Chrome Extension](https://github.com/browserstate/historyjsit.crx) to try out History.js via Ajaxify on select websites without actually installing History.js/Ajaxify on your server.
3740

41+
### Via Ruby On Rails Gem
3842
If you are using Rails, then the easiest way for you to try History.js would be to use [Wiselinks](https://github.com/igor-alexandrov/wiselinks) gem. Wiselinks integrates into Rails application and allows you to start using History.js with three lines of code.
3943

44+
45+
## Direct Install
46+
4047
### Working with History.js directly
4148

4249
``` javascript
@@ -60,6 +67,7 @@ If you are using Rails, then the easiest way for you to try History.js would be
6067
})(window);
6168
```
6269

70+
6371
### How would the above operations look in a HTML5 Browser?
6472

6573
1. www.mysite.com
@@ -74,6 +82,7 @@ If you are using Rails, then the easiest way for you to try History.js would be
7482

7583
> Note: These urls also work in HTML4 browsers and Search Engines. So no need for the hashbang (`#!`) fragment-identifier that google ["recommends"](https://github.com/browserstate/history.js/wiki/Intelligent-State-Handling).
7684
85+
7786
### How would they look in a HTML4 Browser?
7887

7988
1. www.mysite.com
@@ -92,6 +101,7 @@ If you are using Rails, then the easiest way for you to try History.js would be
92101
>
93102
> Note 3: Support for HTML4 browsers (this hash fallback) is optional [- why supporting HTML4 browsers could be either good or bad based on my app's use cases](https://github.com/browserstate/history.js/wiki/Intelligent-State-Handling)
94103
104+
95105
### What's the deal with the SUIDs used in the HTML4 States?
96106

97107
- SUIDs (State Unique Identifiers) are used when we utilise a `title` and/or `data` in our state. Adding a SUID allows us to associate particular states with data and titles while keeping the urls as simple as possible (don't worry it's all tested, working and a lot smarter than I'm making it out to be).
@@ -100,11 +110,13 @@ If you are using Rails, then the easiest way for you to try History.js would be
100110
- It works with domains, subdomains, subdirectories, whatever - doesn't matter where you put it. It's smart.
101111
- Safari 5 will also have a SUID appended to the URL, it is entirely transparent but just a visible side-effect. It is required to fix a bug with Safari 5.
102112

113+
103114
### Is there a working demo?
104115

105116
- Sure is, give it a download and navigate to the demo directory in your browser :-)
106117
- If you are after something a bit more adventurous than a end-user demo, open up the tests directory in your browser and editor - it'll rock your world and show all the vast use cases that History.js supports.
107118

119+
108120
## Download & Installation
109121

110122
- Download History.js and upload it to your webserver. Download links: [tar.gz](https://github.com/browserstate/history.js/tarball/master) or [zip](https://github.com/browserstate/history.js/zipball/master)
@@ -183,6 +195,7 @@ If you are using Rails, then the easiest way for you to try History.js would be
183195
Thanks! every bit of help really does make a difference!
184196

185197

198+
186199
## Browsers: Tested and Working In
187200

188201
### HTML5 Browsers
@@ -193,6 +206,7 @@ Thanks! every bit of help really does make a difference!
193206
- Safari 5.0+
194207
- Safari iOS 4.3+
195208

209+
196210
### HTML4 Browsers
197211

198212
- IE 6, 7, 8, 9, (10)
@@ -202,11 +216,13 @@ Thanks! every bit of help really does make a difference!
202216
- Safari iOS 4.2, 4.1, 4.0, 3.2
203217

204218

219+
205220
## Exposed API
206221

207222
### Functions
208223

209224
#### States
225+
210226
- `History.pushState(data,title,url)` <br/> Pushes a new state to the browser; `data` can be null or an object, `title` can be null or a string, `url` must be a string
211227
- `History.replaceState(data,title,url)` <br/> Replaces the existing state with a new state to the browser; `data` can be null or an object, `title` can be null or a string, `url` must be a string
212228
- `History.getState()` <br/> Gets the current state of the browser, returns an object with `data`, `title` and `url`
@@ -215,16 +231,19 @@ Thanks! every bit of help really does make a difference!
215231
- `History.getHash()` <br/> Gets the current hash of the browser
216232

217233
#### Adapter
234+
218235
- `History.Adapter.bind(element,event,callback)` <br/> A framework independent event binder, you may either use this or your framework's native event binder.
219236
- `History.Adapter.trigger(element,event)` <br/> A framework independent event trigger, you may either use this or your framework's native event trigger.
220237
- `History.Adapter.onDomLoad(callback)` <br/> A framework independent onDomLoad binder, you may either use this or your framework's native onDomLoad binder.
221238

222239
#### Navigation
240+
223241
- `History.back()` <br/> Go back once through the history (same as hitting the browser's back button)
224242
- `History.forward()` <br/> Go forward once through the history (same as hitting the browser's forward button)
225243
- `History.go(X)` <br/> If X is negative go back through history X times, if X is positive go forwards through history X times
226244

227245
#### Debug
246+
228247
- `History.log(...)` <br/> Logs messages to the console, the log element, and fallbacks to alert if neither of those two exist
229248
- `History.debug(...)` <br/> Same as `History.log` but only runs if `History.debug.enable === true`
230249

@@ -243,6 +262,7 @@ Thanks! every bit of help really does make a difference!
243262
- `History.options.html4Mode` <br/> If true, will force HTMl4 mode (hashtags)
244263
- `History.options.delayInit` <br/> Want to override default options and call init manually.
245264

265+
246266
### Events
247267

248268
- `window.onstatechange` <br/> Fired when the state of the page changes (does not include hash changes)
@@ -283,10 +303,10 @@ Thanks! every bit of help really does make a difference!
283303

284304
## History
285305

286-
You can discover the history inside the [History.md](https://github.com/browserstate/history.js/blob/master/History.md#files) file
306+
[You can discover the history inside the `History.md` file](https://github.com/browserstate/history.js/blob/master/History.md#files)
287307

288308

289309
## License
290310

291311
Licensed under the [New BSD License](http://opensource.org/licenses/BSD-3-Clause)
292-
<br/>Copyright &copy; 2011+ [Benjamin Arthur Lupton](http://balupton.com)
312+
<br/>Copyright &copy; 2011+ [Benjamin Arthur Lupton](http://balupton.com) <b@lupton.cc>

0 commit comments

Comments
 (0)