Skip to content

Commit a2aa28b

Browse files
committed
first commit
0 parents  commit a2aa28b

38 files changed

+5479
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# package managers #
2+
####################
3+
node_modules/
4+
npm-debug.log
5+
bower_components/
6+
7+
# generated files #
8+
######################
9+
coverage/
10+
.idea/
11+
.DS_Store
12+
.DS_Store?
13+
._*
14+
.Trashes
15+
Icon?
16+
ehthumbs.db
17+
Thumbs.db
18+
.tmp
19+
tmp/
20+
21+
app/tour-templates.js

.jshintrc

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"node": true,
3+
"browser": true,
4+
"esnext": true,
5+
"bitwise": false,
6+
"camelcase": true,
7+
"curly": true,
8+
"eqeqeq": true,
9+
"immed": true,
10+
"indent": 2,
11+
"latedef": true,
12+
"newcap": true,
13+
"noarg": true,
14+
"quotmark": "single",
15+
"regexp": true,
16+
"undef": true,
17+
"strict": false,
18+
"trailing": true,
19+
"smarttabs": true,
20+
"validthis": true,
21+
"white": true,
22+
"globals":{
23+
"describe": false,
24+
"xdescribe": false,
25+
"it": false,
26+
"xit": false,
27+
"beforeEach": false,
28+
"afterEach": false,
29+
"expect": false,
30+
"spyOn": false,
31+
"define": false,
32+
33+
"angular": false/*,
34+
"Tour": false*/
35+
}
36+
}

.npmignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
node_modules/
2+
npm-debug.log
3+
bower_components/
4+
coverage/
5+
.idea/
6+
.DS_Store
7+
.DS_Store?
8+
._*
9+
.Trashes
10+
Icon?
11+
ehthumbs.db
12+
Thumbs.db
13+
.tmp
14+
tmp
15+
16+
app/tour-templates.js

.travis.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
language: node_js
2+
3+
node_js:
4+
- '0.10'
5+
6+
before_script:
7+
#- npm install -g codeclimate-test-reporter
8+
9+
after_script:
10+
#TODO: enable publishing code coverage reports
11+
#- codeclimate < test/coverage/**/lcov.info
12+
13+
notifications:
14+
# publish build status to IRC channel: #angular-bootstrap-tour
15+
irc:
16+
channels:
17+
- chat.freenode.net#angular-ui-tour
18+
on_success: always
19+
on_failure: always
20+
template:
21+
- '%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}'
22+
- 'Change view : %{compare_url}'
23+
- 'Build details : %{build_url}'
24+
#TODO: enable publishing build status to gitter.im
25+
# publish build status to gitter chat room: https://gitter.im/benmarch/angular-bootstrap-tour
26+
#webhooks:
27+
# urls:
28+
# - [REPLACE WITH YOUR WEBHOOK URL; https://webhooks.gitter.im/e/XXXXXXXXXXXXXXXX]
29+
# on_success: always
30+
# on_failure: always
31+
# on_start: false
32+
33+
env:
34+
#- CODECLIMATE_REPO_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

.umd

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(function (window, factory) {
2+
'use strict';
3+
if (typeof define === 'function' && define.amd) {
4+
// AMD
5+
define([], factory);
6+
} else if (typeof exports === 'object') {
7+
// Node.js
8+
module.exports = factory();
9+
} else {
10+
// Browser
11+
window.angularBootstrapTour = factory();
12+
}
13+
}(this, function factory() {
14+
// public API
15+
return $1;
16+
}));

README.md

+180
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# angular-bootstrap-tour
2+
[![Bower Version][bower-image]][bower-url]
3+
4+
## No more jQuery!!
5+
6+
This repo is a work in progress to replace [Angular Bootstrap Tour](http://github.com/benmarch/angular-bootstrap-tour).
7+
8+
Stand by, full test suite to come, as well as implementing as many of Bootstrap Tour's features as possible.
9+
**Everything below was copied from other repo and needs to be reviewed**
10+
11+
## About
12+
13+
This is a simple Angular wrapper around [Bootstrap Tour](http://www.bootstraptour.com).
14+
Simply add the "tour" directive anywhere, and add the "tour-step" directive to any element within "tour" that needs a tip.
15+
16+
All [options](http://bootstraptour.com/api/) are available by adding the corresponding attributes to the directive element.
17+
18+
There is also a "skip" option that if evaluates to true, will skip over the step.
19+
20+
This repository was scaffolded with [generator-microjs](https://github.com/daniellmb/generator-microjs).
21+
22+
## Getting Started
23+
Get the package:
24+
25+
bower install angular-bootstrap-tour
26+
27+
Add the script tags:
28+
29+
<script src="bower_components/jquery/dist/jquery.js"></script>
30+
<script src="bower_components/angular/angular.js"></script>
31+
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
32+
<script src="bower_components/bootstrap-tour/build/js/bootstrap-tour.js"></script>
33+
<script src="bower_components/angular-bootstrap-tour/dist/angular-bootstrap-tour.js"></script>
34+
35+
And the Bootstrap Tour CSS (or create your own):
36+
37+
<link rel="stylesheet" href="bower_components/bootstrap-tour/build/css/bootstrap-tour.css" />
38+
39+
Then add the module to your app:
40+
41+
angular.module('myApp', ['bm.uiTour']);
42+
43+
## Configuration
44+
45+
The TourConfigProvider allows you to set a couple options:
46+
- `prefixOptions` {boolean, default: false} if set to true will require directive options to be prefixed to avoid conflicts
47+
- `prefix` {string, default: 'uiTour'} the prefix to use if `prefixOptions` is set to `true`
48+
49+
Use `TourConfigProvider.set(<option>, <value>)` in your app's config block to change the settings
50+
51+
You can use either `tour` and `tourStep` or `uiTour` and `uiTourStep` as directive names without changing config.
52+
53+
## Examples
54+
55+
<div tour placement="top" on-end="onTourEnd(tour)" after-get-state="afterGetStateFunction" template-url="tour_template.html">
56+
<div id="mainMenu" tour-step title="Main Menu" content="{{mainMenuDescription}}" order="0" skip="pageName !== 'home'">
57+
...
58+
</div>
59+
60+
...
61+
62+
</div>
63+
64+
65+
### Tour Directive
66+
67+
The tour directive creates a wrapper that contains all tour steps, and adds the tour object to the scope. If no options are specified, they all default to Bootstrap Tour's defaults.
68+
Values of event handler options will be evaluated against the tour's scope. For the afterGetState, afterSetState, and afterRemoveState, the value should
69+
evaluate to a function that takes 2 arguments, key and value. The container option should be a CSS selector, and defaults to "body".
70+
You can also pass an object to the tour-options attribute that will override any other attribute options.
71+
72+
### TourStep Directive
73+
74+
The tour-step directive takes all the options available in Bootstrap Tour, with a few alterations. Instead of next and prev options, just use the "order" option.
75+
Order is used as a weighting (0 is first) and the plugin will dynamically determine which ones come before and after. If order is ommitted, it will default to 0.
76+
Multiple steps can have the same order, and those will display in the order that they are linked (usually the order in which they appear in the DOM.)
77+
If order is omitted from all tour-steps, the order will be whatever order in which they are linked. Steps can be skipped by passing the "skip" option an expression that evaluates to a boolean.
78+
The expression is evaluated before each step, so it can be a dynamic expression. This is useful if you have steps in a global layout, but only want to show them on the home page.
79+
Steps that are on hidden elements will not be shown. (Hidden means truly hidden, not obscured.)
80+
The title and contents options are watched, so an interpolated value can be passed.
81+
82+
## Compatibility
83+
84+
I have tested it and found it working in the following browsers:
85+
86+
- IE8, 9, 10, 11
87+
- Firefox 32
88+
- Chrome 37
89+
- Safari 7
90+
91+
92+
## TODO's
93+
94+
- Write some tests!! (Come on Ben, stop being lazy ;p)
95+
96+
## Build It Yourself
97+
98+
Assuming you have Node, grunt, and bower installed:
99+
100+
npm install
101+
102+
bower install
103+
104+
grunt
105+
106+
## Demo
107+
108+
I have set up a simple demo using the Bootswatch Cerulean demo page (one of my favorite themes.) To run the demo run `grunt demo` and open demo/index.html in the browser.
109+
110+
111+
## Notes
112+
113+
I am using this in a personal project, but I haven't needed to use all the Bootstrap Tour options. This means that some of them might not be working
114+
due to the option values either not being passed correctly, or not being passed as interpolated values.
115+
If you run across any issues please report them with an example and I will fix them ASAP, or fork me and create a PR.
116+
You can now pass a template URL to either the tour or tour-step directives, and the template will be linked to whichever scope the template is specified on.
117+
(ie. if you add the template URL to the tour directive, it will always use the tour directive's scope, if you add it to a step, it will use the step's scope.)
118+
Alternatively, you can specify an expression that evaluates to a string that will be used as the template (using the "template" attribute.)
119+
120+
Thanks and enjoy!
121+
122+
## License
123+
124+
(The MIT License)
125+
126+
Copyright (c) 2014
127+
128+
Permission is hereby granted, free of charge, to any person obtaining
129+
a copy of this software and associated documentation files (the
130+
'Software'), to deal in the Software without restriction, including
131+
without limitation the rights to use, copy, modify, merge, publish,
132+
distribute, sublicense, and/or sell copies of the Software, and to
133+
permit persons to whom the Software is furnished to do so, subject to
134+
the following conditions:
135+
136+
The above copyright notice and this permission notice shall be
137+
included in all copies or substantial portions of the Software.
138+
139+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
140+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
141+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
142+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
143+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
144+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
145+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
146+
147+
148+
149+
[build-url]: https://travis-ci.org/benmarch/angular-bootstrap-tour
150+
[build-image]: http://img.shields.io/travis/benmarch/angular-bootstrap-tour.png
151+
152+
[gpa-url]: https://codeclimate.com/github/benmarch/angular-bootstrap-tour
153+
[gpa-image]: https://codeclimate.com/github/benmarch/angular-bootstrap-tour.png
154+
155+
[coverage-url]: https://codeclimate.com/github/benmarch/angular-bootstrap-tour/code?sort=covered_percent&sort_direction=desc
156+
[coverage-image]: https://codeclimate.com/github/benmarch/angular-bootstrap-tour/coverage.png
157+
158+
[depstat-url]: https://david-dm.org/benmarch/angular-bootstrap-tour
159+
[depstat-image]: https://david-dm.org/benmarch/angular-bootstrap-tour.png?theme=shields.io
160+
161+
[issues-url]: https://github.com/benmarch/angular-bootstrap-tour/issues
162+
[issues-image]: http://img.shields.io/github/issues/benmarch/angular-bootstrap-tour.png
163+
164+
[bower-url]: http://bower.io/search/?q=angular-bootstrap-tour
165+
[bower-image]: https://badge.fury.io/bo/angular-bootstrap-tour.png
166+
167+
[downloads-url]: https://www.npmjs.org/package/angular-bootstrap-tour
168+
[downloads-image]: http://img.shields.io/npm/dm/angular-bootstrap-tour.png
169+
170+
[npm-url]: https://www.npmjs.org/package/angular-bootstrap-tour
171+
[npm-image]: https://badge.fury.io/js/angular-bootstrap-tour.png
172+
173+
[irc-url]: http://webchat.freenode.net/?channels=angular-bootstrap-tour
174+
[irc-image]: http://img.shields.io/badge/irc-%23angular-bootstrap-tour-brightgreen.png
175+
176+
[gitter-url]: https://gitter.im/benmarch/angular-bootstrap-tour
177+
[gitter-image]: http://img.shields.io/badge/gitter-benmarch/angular-bootstrap-tour-brightgreen.png
178+
179+
[tip-url]: https://www.gittip.com/benmarch
180+
[tip-image]: http://img.shields.io/gittip/benmarch.png

app/angular-ui-tour.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* global Tour: false */
2+
3+
(function angularUITour(app) {
4+
'use strict';
5+
6+
app.config(['$tooltipProvider', function ($tooltipProvider) {
7+
$tooltipProvider.setTriggers({
8+
'uiTourShow': 'uiTourHide'
9+
});
10+
}]);
11+
12+
}(angular.module('bm.uiTour', ['ui.bootstrap', 'smoothScroll'])));

app/templates/tour-step-template.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div>
2+
<div class="popover-content">{{tourStep.content}}</div>
3+
<div class="popover-navigation">
4+
<div class="btn-group">
5+
<button class="btn btn-sm btn-default" data-role="prev" ng-click="tour.prev()">&laquo; Prev</button>
6+
<button class="btn btn-sm btn-default" data-role="next" ng-click="tour.next()">Next &raquo;</button>
7+
<button class="btn btn-sm btn-default" data-role="pause-resume" data-pause-text="Pause"
8+
data-resume-text="Resume" ng-click="tour.pause()">Pause
9+
</button>
10+
</div>
11+
<button class="btn btn-sm btn-default" data-role="end" ng-click="tour.end()">End tour</button>
12+
</div>
13+
</div>

app/tour-config-provider.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* global angular: false */
2+
3+
(function (app) {
4+
'use strict';
5+
6+
app.provider('TourConfig', [function () {
7+
8+
var config = {
9+
prefixOptions: false,
10+
prefix: 'uiTour'
11+
};
12+
13+
this.set = function (option, value) {
14+
config[option] = value;
15+
};
16+
17+
this.$get = [function () {
18+
19+
var service = {};
20+
21+
service.get = function (option) {
22+
return config[option];
23+
};
24+
25+
return service;
26+
27+
}];
28+
29+
}]);
30+
31+
}(angular.module('bm.uiTour')));

0 commit comments

Comments
 (0)