Skip to content

Commit 0a1565e

Browse files
author
Guillaume AMAT
committed
Merge branch 'master' of https://github.com/usablica/intro.js into patch-1
Conflicts: introjs.css
2 parents e161504 + 3a2d855 commit 0a1565e

17 files changed

+1502
-90
lines changed

.spmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BUILD
2+
example
3+
minified

README.md

Lines changed: 58 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ You can obtain your local copy of Intro.js from:
99

1010
**2)** Using bower ```bower install intro.js --save```
1111

12-
**3)** Download it from CDN ([1](http://www.jsdelivr.com/#!intro.js), [2](http://cdnjs.com/#introjs))
12+
**3)** Using npm ```npm install intro.js --save```
13+
14+
**4)** Download it from CDN ([1](http://www.jsdelivr.com/#!intro.js), [2](http://cdnjs.com/#introjs))
1315

1416

1517
## How to use
@@ -19,26 +21,40 @@ Intro.js can be added to your site in three simple steps:
1921

2022
> CDN hosted files are available at [jsDelivr](http://www.jsdelivr.com/#!intro.js) (click Show More) & [cdnjs](http://cdnjs.com/#introjs).
2123
22-
**2)** Add `data-intro` and `data-step` to your HTML elements.
24+
**2)** Add `data-intro` and `data-step` to your HTML elements.
2325

24-
For example:
26+
For example:
2527

2628
```html
2729
<a href='http://google.com/' data-intro='Hello step one!'></a>
2830
````
2931

3032
See all attributes [here](https://github.com/usablica/intro.js/#attributes).
31-
33+
3234
**3)** Call this JavaScript function:
3335
```javascript
3436
introJs().start();
3537
````
36-
38+
3739
Optionally, pass one parameter to `introJs` function to limit the presentation section.
3840

3941
**For example** `introJs(".introduction-farm").start();` runs the introduction only for elements with `class='introduction-farm'`.
4042

41-
<p align="center"><img src="http://usablica.github.com/intro.js/img/introjs-demo.png"></p>
43+
<p align="center"><img src="http://usablica.github.com/intro.js/img/introjs-demo.png"></p>
44+
45+
## Using templates
46+
47+
IntroJS provides awesome templates and we are trying to update and add more templates for next versions. You can browse all templates here: https://github.com/usablica/intro.js/wiki/IntroJs-templates
48+
49+
In order to use templates, all you need to do is appending the template stylesheet to your page, *after* IntroJS CSS file:
50+
51+
```html
52+
<!-- Add IntroJs styles -->
53+
<link href="../../introjs.css" rel="stylesheet">
54+
55+
<!-- Add Nazanin template -->
56+
<link href="../../themes/introjs-nazanin.css" rel="stylesheet">
57+
```
4258

4359
## API
4460

@@ -228,7 +244,7 @@ introJs().oncomplete(function() {
228244
229245
###introJs.onexit(providedCallback)
230246
231-
Set callback to exit of introduction. Exit also means pressing `ESC` key and clicking on the overlay layer by the user.
247+
Set callback to exit of introduction. Exit also means pressing `ESC` key and clicking on the overlay layer by the user.
232248
233249
**Available since:** v0.2.0
234250
@@ -262,7 +278,7 @@ The callback function receives the element of the new step as an argument.
262278

263279
**Example:**
264280
```javascript
265-
introJs().onchange(function(targetElement) {
281+
introJs().onchange(function(targetElement) {
266282
alert("new step");
267283
});
268284
````
@@ -283,7 +299,7 @@ Given callback function will be called before starting a new step of introductio
283299

284300
**Example:**
285301
```javascript
286-
introJs().onbeforechange(function(targetElement) {
302+
introJs().onbeforechange(function(targetElement) {
287303
alert("before new step");
288304
});
289305
````
@@ -304,7 +320,7 @@ Given callback function will be called after starting a new step of introduction
304320

305321
**Example:**
306322
```javascript
307-
introJs().onafterchange(function(targetElement) {
323+
introJs().onafterchange(function(targetElement) {
308324
alert("after new step");
309325
});
310326
````
@@ -314,7 +330,7 @@ introJs().onafterchange(function(targetElement) {
314330
- `data-intro`: The tooltip text of step
315331
- `data-step`: Optionally define the number (priority) of step
316332
- `data-tooltipClass`: Optionally define a CSS class for tooltip
317-
- `data-position`: Optionally define the position of tooltip, `top`, `left`, `right` or `bottom`. Default is `bottom`
333+
- `data-position`: Optionally define the position of tooltip, `top`, `left`, `right`, `bottom`, `bottom-left-aligned` (same as 'bottom'), 'bottom-middle-aligned' and 'bottom-right-aligned'. Default is `bottom`
318334

319335
###Options:
320336

@@ -332,6 +348,8 @@ introJs().onafterchange(function(targetElement) {
332348
- `showButtons`: Show introduction navigation buttons or not, `true` or `false`
333349
- `showBullets`: Show introduction bullets or not, `true` or `false`
334350
- `scrollToElement`: Auto scroll to highlighted element if it's outside of viewport, `true` or `false`
351+
- `overlayOpacity`: Adjust the overlay opacity, `Number`
352+
- `disableInteraction`: Disable an interaction inside element or not, `true` or `false`
335353
336354
See [setOption](https://github.com/usablica/intro.js/#introjssetoptionoption-value) to see an example.
337355
@@ -364,23 +382,36 @@ Now you can run this command to minify all static resources:
364382
365383
## Instant IntroJs
366384
367-
Want to learn faster and easier? Here we have **Instant IntroJs**, Packt Publishing.
385+
Want to learn faster and easier? Here we have **Instant IntroJs**, Packt Publishing.
368386
369387
<p align="center">
370388
<a target='_blank' href="http://www.packtpub.com/create-useful-introductions-for-websites-and-applications-with-introjs-library/book"><img src='http://dgdsbygo8mp3h.cloudfront.net/sites/default/files/imagecache/productview_larger/2517OS_Instant%20IntroJS%20Starter.jpg' /></a>
371-
</p>
389+
</p>
372390

373391
<p align="center">
374392
<a target='_blank' href="http://www.packtpub.com/create-useful-introductions-for-websites-and-applications-with-introjs-library/book">Buy and Download</a>
375393
</p>
376394

377395
## Roadmap
378-
- Add introduction without focusing on elements
379396
- Fix problems with `position: fixed` and other positions
380397
- Provide more examples
398+
- Add more templates
381399

382400
## Release History
383401

402+
* **v0.9.0** - 2014-05-23
403+
- Add IntroJS templates
404+
- Add more tooltip positions (bottom-right, bottom-middle, bottom-left)
405+
- Fix table `tr` element's issue
406+
407+
* **v0.8.0** - 2014-03-25
408+
- Ability to define introductions without focusing on elements
409+
- Fix Internet Explorer 8.0 issue
410+
- Add `_direction` property
411+
412+
* **v0.7.1** - 2014-03-11
413+
- Fix "Too much recursion" issue with Firefox and Internet Explorer.
414+
384415
* **v0.7.0** - 2014-02-07
385416
- Add `onafterchange` event
386417
- Add scrolling to element option
@@ -451,17 +482,17 @@ Want to learn faster and easier? Here we have **Instant IntroJs**, Packt Publish
451482
- Fix show element for elements with position `absolute` or `relative`
452483
- Add `enter` key for navigating in steps
453484
- Code refactoring
454-
455-
456-
* **v0.1.0** - 2013-03-16
457-
- First commit.
485+
486+
487+
* **v0.1.0** - 2013-03-16
488+
- First commit.
458489
459490
## Author
460491
**Afshin Mehrabani**
461492
462493
- [Twitter](https://twitter.com/afshinmeh)
463494
- [Github](https://github.com/afshinm)
464-
- [Personal page](http://afshinm.name/)
495+
- [Personal page](http://afshinm.name/)
465496
466497
[Other contributors](https://github.com/usablica/intro.js/graphs/contributors)
467498
@@ -473,15 +504,15 @@ Want to learn faster and easier? Here we have **Instant IntroJs**, Packt Publish
473504
## License
474505
> Copyright (C) 2012 Afshin Mehrabani ([email protected])
475506
476-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
477-
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
478-
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
507+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
508+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
509+
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
479510
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
480-
The above copyright notice and this permission notice shall be included in all copies or substantial portions
511+
The above copyright notice and this permission notice shall be included in all copies or substantial portions
481512
of the Software.
482513
483-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
484-
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
485-
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
486-
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
514+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
515+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
516+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
517+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
487518
IN THE SOFTWARE.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "intro.js",
3-
"version": "0.7.0",
3+
"version": "0.9.0",
44
"description": "A better way for new feature introduction and step-by-step users guide for your website and project.",
55
"keywords": ["demo", "intro", "introduction"],
66
"homepage": "http://usablica.github.com/intro.js/",

component.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "intro.js",
3+
"repo": "usablica/intro.js",
4+
"description": "Better introductions for websites and features with a step-by-step guide for your projects",
5+
"version": "0.9.0",
6+
"main": "intro.js",
7+
"scripts": [
8+
"intro.js"
9+
],
10+
"styles": [
11+
"introjs.css"
12+
]
13+
}

example/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ <h3 class="muted">Examples</h3>
2929
<li><a href="RTL/index.html" title='RTL version'>RTL version</a></li>
3030
<li><a href="html-tooltip/index.html" title='HTML in tooltip'>HTML in tooltip</a></li>
3131
<li><a href="custom-class/index.html" title='Custom CSS Class'>Custom CSS Class</a></li>
32+
<li><a href="withoutElement/index.html" title='Introduction without focusing on elements'>Introduction without focusing on elements</a></li>
3233
</ul>
3334
</div>
3435
</body>

example/programmatic/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ <h4>Section Six</h4>
7474
var intro = introJs();
7575
intro.setOptions({
7676
steps: [
77+
{
78+
intro: "Hello world!"
79+
},
7780
{
7881
element: document.querySelector('#step1'),
7982
intro: "This is a tooltip."

example/withoutElement/index.html

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Intro without focusing on elements</title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta name="description" content="Intro.js - Better introductions for websites and features with a step-by-step guide for your projects.">
8+
<meta name="author" content="Afshin Mehrabani (@afshinmeh) in usabli.ca group">
9+
10+
<!-- styles -->
11+
<link href="../assets/css/bootstrap.min.css" rel="stylesheet">
12+
<link href="../assets/css/demo.css" rel="stylesheet">
13+
14+
<!-- Add IntroJs styles -->
15+
<link href="../../introjs.css" rel="stylesheet">
16+
17+
<link href="../assets/css/bootstrap-responsive.min.css" rel="stylesheet">
18+
</head>
19+
20+
<body>
21+
22+
<div class="container-narrow">
23+
24+
<div class="masthead">
25+
<ul id="step5" class="nav nav-pills pull-right">
26+
<li><a href="https://github.com/usablica/intro.js/tags"><i class='icon-black icon-download-alt'></i> Download</a></li>
27+
<li><a href="https://github.com/usablica/intro.js">Github</a></li>
28+
<li><a href="https://twitter.com/usablica">@usablica</a></li>
29+
</ul>
30+
<h3 class="muted">Intro.js</h3>
31+
</div>
32+
33+
<hr>
34+
35+
<div class="jumbotron">
36+
<h1 id="step1">Without Element</h1>
37+
<p id="step4" class="lead">This example shows the introductions without focusing on elements.</p>
38+
<a class="btn btn-large btn-success" href="javascript:void(0);" onclick="startIntro();">Show me how</a>
39+
</div>
40+
41+
<hr>
42+
43+
<div class="row-fluid marketing">
44+
<div id="step2" class="span6">
45+
<h4>Section One</h4>
46+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mollis augue a neque cursus ac blandit orci faucibus. Phasellus nec metus purus.</p>
47+
48+
<h4>Section Two</h4>
49+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mollis augue a neque cursus ac blandit orci faucibus. Phasellus nec metus purus.</p>
50+
51+
<h4>Section Three</h4>
52+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mollis augue a neque cursus ac blandit orci faucibus. Phasellus nec metus purus.</p>
53+
</div>
54+
55+
<div id="step3" class="span6">
56+
<h4>Section Four</h4>
57+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mollis augue a neque cursus ac blandit orci faucibus. Phasellus nec metus purus.</p>
58+
59+
60+
<h4>Section Five</h4>
61+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mollis augue a neque cursus ac blandit orci faucibus. Phasellus nec metus purus.</p>
62+
63+
<h4>Section Six</h4>
64+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mollis augue a neque cursus ac blandit orci faucibus. Phasellus nec metus purus.</p>
65+
</div>
66+
</div>
67+
68+
<hr>
69+
70+
</div>
71+
<script type="text/javascript" src="../../intro.js"></script>
72+
<script type="text/javascript">
73+
function startIntro(){
74+
var intro = introJs();
75+
intro.setOptions({
76+
steps: [
77+
{
78+
intro: "Hello world!"
79+
},
80+
{
81+
intro: "You <b>don't need</b> to define element to focus, this is a floating tooltip."
82+
},
83+
{
84+
element: document.querySelector('#step1'),
85+
intro: "This is a tooltip."
86+
},
87+
{
88+
element: document.querySelectorAll('#step2')[0],
89+
intro: "Ok, wasn't that fun?",
90+
position: 'right'
91+
},
92+
{
93+
element: '#step3',
94+
intro: 'More features, more fun.',
95+
position: 'left'
96+
},
97+
{
98+
element: '#step4',
99+
intro: "Another step.",
100+
position: 'bottom'
101+
},
102+
{
103+
element: '#step5',
104+
intro: 'Get it, use it.'
105+
}
106+
]
107+
});
108+
109+
intro.start();
110+
}
111+
</script>
112+
</body>
113+
</html>

0 commit comments

Comments
 (0)