Skip to content

Commit e893c66

Browse files
committed
Merge branch 'master' of git://github.com/usablica/intro.js
2 parents e83e429 + e9fc909 commit e893c66

17 files changed

+726
-9768
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

BUILD/BUILD.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env node
2+
3+
var fs = require('fs'),
4+
compressor = require('node-minify');
5+
6+
new compressor.minify({
7+
type: 'gcc',
8+
fileIn: '../intro.js',
9+
fileOut: '../minified/intro.min.js',
10+
callback: function (err) {
11+
if (err) {
12+
console.log(err);
13+
} else {
14+
console.log("JS minified successfully.");
15+
}
16+
}
17+
});
18+
19+
new compressor.minify({
20+
type: 'yui-css',
21+
fileIn: '../introjs.css',
22+
fileOut: '../minified/introjs.min.css',
23+
callback: function (err) {
24+
if (err) {
25+
console.log(err);
26+
} else {
27+
console.log("Main CSS minified successfully.");
28+
}
29+
}
30+
});
31+
32+
new compressor.minify({
33+
type: 'yui-css',
34+
fileIn: '../introjs-ie.css',
35+
fileOut: '../minified/introjs-ie.min.css',
36+
callback: function (err) {
37+
if (err) {
38+
console.log(err);
39+
} else {
40+
console.log("IE bugfix CSS minified successfully.");
41+
}
42+
}
43+
});

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
BASE = .
2+
3+
build:
4+
cd BUILD && node BUILD.js
5+
6+
.PHONY: build

README.md

Lines changed: 141 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,173 @@
1-
Intro.js
2-
========
1+
# Intro.js
32

4-
Better introductions for websites and features with a step-by-step guide for your projects.
3+
> Better introductions for websites and features with a step-by-step guide for your projects.
54
6-
##How to use
5+
6+
## How to use
77
Intro.js can be added to your site in three simple steps:
88

99
**1)** Include `intro.js` and `introjs.css` (or the minified version for production) in your page.
1010

1111
**2)** Add `data-intro` and `data-step` to your HTML elements.
12+
1213
For example:
14+
1315
```html
1416
<a href='http://google.com/' data-intro='Hello step one!' data-step='1'></a>
1517
````
18+
19+
Optionally you can define `data-position` attribute to define the position of tooltip with values `top`, `right`, `left` and `bottom`. Default value is `bottom`.
1620

1721
**3)** Call this JavaScript function:
1822
```javascript
1923
introJs().start();
2024
````
2125

22-
Optionally, pass one parameter to `introJs` function to limit the presentation section, for example `introJs(".introduction-farm").start();` runs the introduction only for elements with `class='introduction-farm'`.
26+
Optionally, pass one parameter to `introJs` function to limit the presentation section.
27+
28+
**For example** `introJs(".introduction-farm").start();` runs the introduction only for elements with `class='introduction-farm'`.
29+
30+
<p align="center"><img src="http://usablica.github.com/intro.js/img/introjs-demo.png"></p>
31+
32+
## API
2333

24-
##Using with:
34+
###introJs([targetElm])
2535

26-
###Rails
36+
Creating an introJs object.
37+
38+
**Available since**: v0.1.0
39+
40+
**Parameters:**
41+
- targetElm : String (optional)
42+
Should be defined to start introduction for specific element, for example: `#intro-farm`.
43+
44+
**Returns:**
45+
- introJs object.
46+
47+
**Example:**
48+
```javascript
49+
introJs() //without selector, start introduction for whole page
50+
introJs("#intro-farm") //start introduction for element id='intro-farm'
51+
````
52+
53+
###introJs.start()
2754

55+
Start the introduction for defined element(s).
56+
57+
**Available since**: v0.1.0
58+
59+
**Returns:**
60+
- introJs object.
61+
62+
**Example:**
63+
```javascript
64+
introJs().start()
65+
````
66+
67+
###introJs.oncomplete(providedCallback)
68+
69+
Set callback for when introduction completed.
70+
71+
**Available since**: v0.2.0
72+
73+
**Parameters:**
74+
- providedCallback : Function
75+
76+
**Returns:**
77+
- introJs object.
78+
79+
**Example:**
80+
```javascript
81+
introJs().oncomplete(function() {
82+
alert("end of introduction");
83+
});
84+
````
85+
86+
###introJs.onexit(providedCallback)
87+
88+
Set callback to exit of introduction. Exit also means pressing `ESC` key and clicking on the overlay layer by the user.
89+
90+
**Available since:** v0.2.0
91+
92+
**Parameters:**
93+
- providedCallback : Function
94+
95+
**Returns:**
96+
- introJs object.
97+
98+
**Example:**
99+
```javascript
100+
introJs().onexit(function() {
101+
alert("exit of introduction");
102+
});
103+
````
104+
105+
## Using with:
106+
107+
### Rails
28108
If you are using the rails asset pipeline you can use the [introjs-rails](https://github.com/heelhook/intro.js-rails) gem.
29109

30-
###Yii framework
110+
### Yii framework
31111
You can simply use this project for Yii framework: https://github.com/moein7tl/Yii-IntroJS
32112

33-
##Roadmap
113+
114+
## Build
115+
116+
First you should install `nodejs` and `npm`, then first run this command: `npm install` to install all dependencies.
117+
118+
Now you can run this command to minify all static resources:
119+
120+
make build
121+
122+
123+
## Roadmap
34124
- More browser compatibility
35-
- Adding ability to define tooltip position in each step, `top`, `left,` `right` and `bottom`
36-
- Fix overlay layer bug while using it in wide monitors and `document` object
37-
- Change `Next` and `Skip` buttons
38-
- Add complete introduction callback
39125

40-
##Main Contributors
41-
- [Afshin Mehrabani](http://afshinm.name/)
42126

43-
other contributors: https://github.com/usablica/intro.js/contributors
127+
## Release History
128+
* **v0.2.1** - 2013-03-20
129+
- Fix keydown event unbinding bug.
130+
131+
* **v0.2.0** - 2013-03-20
132+
- Ability to define tooltip position with `data-position` attribute
133+
- Add `onexit` and `oncomplete` callback
134+
- Better scrolling functionality
135+
- Redesign navigating buttons + add previous button
136+
- Fix overlay layer bug in wide monitors
137+
- Fix show element for elements with position `absolute` or `relative`
138+
- Add `enter` key for navigating in steps
139+
- Code refactoring
140+
141+
142+
* **v0.1.0** - 2013-03-16
143+
- First commit.
144+
145+
## Author
146+
**Afshin Mehrabani**
44147

45-
##Support/Discussion
148+
- [Twitter](https://twitter.com/afshinmeh)
149+
- [Github](https://github.com/afshinm)
150+
- [Personal page](http://afshinm.name/)
46151

152+
[Other contributors](https://github.com/usablica/intro.js/graphs/contributors)
153+
154+
155+
## Support/Discussion
47156
- [Google Group](https://groups.google.com/d/forum/introjs)
48157

49-
##License
50158

51-
Copyright (C) 2012 Afshin Mehrabani ([email protected])
52-
53-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
54-
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
55-
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
56-
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
57-
The above copyright notice and this permission notice shall be included in all copies or substantial portions
58-
of the Software.
59-
60-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
61-
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
62-
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
63-
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
64-
IN THE SOFTWARE.
159+
## License
160+
> Copyright (C) 2012 Afshin Mehrabani ([email protected])
161+
162+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
163+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
164+
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
165+
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
166+
The above copyright notice and this permission notice shall be included in all copies or substantial portions
167+
of the Software.
168+
169+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
170+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
171+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
172+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
173+
IN THE SOFTWARE.

0 commit comments

Comments
 (0)