Skip to content

Commit de31f8a

Browse files
author
rstaib
committed
Add code API and readme content
1 parent caa61ad commit de31f8a

File tree

3 files changed

+455
-169
lines changed

3 files changed

+455
-169
lines changed

Gruntfile.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ module.exports = function (grunt)
3737
src: [
3838
'README.md',
3939
/*'changelog.txt',*/
40-
'demo/** /*.*',
40+
'docs/**/*.*',
41+
'demo/**/*.*',
4142
'lib/*.*',
42-
'test/** /*.*'
43+
'test/**/*.*'
4344
]
4445
},
4546
{
@@ -104,6 +105,18 @@ module.exports = function (grunt)
104105
]
105106
}
106107
}
108+
},
109+
yuidoc: {
110+
compile: {
111+
name: '<%= pkg.name %>',
112+
description: '<%= pkg.description %>',
113+
version: '<%= pkg.version %>',
114+
url: '<%= pkg.homepage %>',
115+
options: {
116+
paths: '.',
117+
outdir: 'docs/'
118+
}
119+
}
107120
}
108121
});
109122

@@ -114,6 +127,6 @@ module.exports = function (grunt)
114127
grunt.loadNpmTasks('grunt-contrib-yuidoc');
115128
grunt.loadNpmTasks('grunt-contrib-compress');
116129

117-
grunt.registerTask('default', ['jshint'/*, 'qunit'*/]);
118-
grunt.registerTask('release', ['default', 'concat'/*, 'yuidoc'*/, 'uglify', 'compress']);
130+
grunt.registerTask('default', ['jshint'/*, 'qunit'*/, 'yuidoc']);
131+
grunt.registerTask('release', ['default', 'concat', 'uglify', 'compress']);
119132
};

README.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,66 @@
1-
jquery-steps
1+
jQuery Steps Plugin [![Build Status](https://secure.travis-ci.org/rstaib/jquery-steps.png)](http://travis-ci.org/rstaib/jquery-steps)
22
============
33

44
A powerful jQuery wizard plugin that supports accessibility and HTML5.
55

6-
[![Build Status](https://secure.travis-ci.org/rstaib/jquery-steps.png)](http://travis-ci.org/rstaib/jquery-steps)
6+
## Getting Started
7+
8+
jQuery Steps is a lightweight wizard UI component written for jQuery.
9+
10+
Everything you need to start is:
11+
12+
1. Include *jQuery* and *jQuery Steps* in your HTML code.
13+
2. Then select an element represents the wizard and call the `steps` method.
14+
15+
```html
16+
<!DOCTYPE html>
17+
<html>
18+
<head>
19+
<title>Demo</title>
20+
<meta charset="utf-8">
21+
<script src="jquery.js"></script>
22+
<script src="jquery.steps.js"></script>
23+
</head>
24+
<body>
25+
<script>
26+
$("#wizard").steps();
27+
</script>
28+
<div id="wizard"></div>
29+
</body>
30+
</html>
31+
```
32+
33+
### How to add initial steps?
34+
35+
There are two ways to add steps and their corresponding content.
36+
37+
1. Add HTML code into the representing wizard element.
38+
39+
```html
40+
<div id="wizard">
41+
<h1>First Step</h1>
42+
<div>First Content</div>
43+
44+
<h1>Second Step</h1>
45+
<div>Second Content</div>
46+
</div>
47+
```
48+
49+
2. Or use the API to add steps dynamically.
50+
51+
```javascript
52+
<script>
53+
// Initialize wizard
54+
var wizard = $("#wizard").steps();
55+
56+
// Add step
57+
wizard.steps("add", {
58+
title: "HTML code",
59+
content: "<strong>HTML code</strong>"
60+
});
61+
</script>
62+
```
63+
64+
## License
65+
66+
Copyright (c) 2013 Rafael J. Staib Licensed under the [MIT license](https://github.com/rstaib/jquery-steps/blob/master/LICENSE.txt).

0 commit comments

Comments
 (0)