Skip to content

Commit 1e4db7a

Browse files
committed
Merge pull request #5 from asaskevich/master
bower package
2 parents 684c4e6 + 6c5095a commit 1e4db7a

File tree

2 files changed

+79
-73
lines changed

2 files changed

+79
-73
lines changed

README.md

Lines changed: 55 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
1-
2-
About
1+
EnjoyHint
32
=========
4-
53
**EnjoyHint** is a web-tool that provides the simplest way to create interactive tutorials and hints for your site or web-application. It can also be used to highlight and sign application elements.
64

75
EnjoyHint is free software distributed under the terms of MIT license.
86

97
Check out this [issue tracker demo with EnjoyHint](http://xbsoftware.com/products/enjoyhint/) and a [TODO app demo](http://xbsoftware.github.io/enjoyhint/) ([downloadable package](http://xbsoftware.github.io/enjoyhint/enjoyhint_todo_demo.zip))
108

11-
Dependencies
12-
=========
9+
#### Dependencies
1310
EnjoyHint require the following plugins and libs:
1411

15-
1. Jquery >1.7
16-
2. kineticJS v5.1.0(included into js file)
12+
* jQuery > 1.7
13+
* KineticJS v5.1.0 (included into js file)
1714

18-
Installation
19-
=========
20-
1. Download the latest version of EnjoyHint
21-
2. Extract the archive with EnjoyHint.
22-
3. Move the EnjoyHint directory to somewhere on your webserver
23-
4. Insert next lines into your page's \<head\> tag:
15+
#### Installation
16+
You can install it through `bower` package manager:
17+
```
18+
bower install enjoyhint
2419
```
20+
Alternative way:
21+
- Download the latest version of EnjoyHint
22+
- Extract the archive with EnjoyHint.
23+
- Move the EnjoyHint directory to somewhere on your webserver
24+
- Insert next lines into your page's \<head\> tag:
25+
```html
2526
<link href="<pathontheserver>/enjoyhint/enjoyhint.css" rel="stylesheet">
26-
2727
<script src="<pathontheserver>/enjoyhint/enjoyhint.min.js"></script>
2828
```
2929

30-
Initialization and configuration:
31-
=========
32-
```
30+
#### Initialization and configuration:
31+
```javascript
3332
//initialize instance
3433
var enjoyhint_instance = new EnjoyHint({});
3534

@@ -51,89 +50,73 @@ enjoyhint_instance.setScript(enjoyhint_script_steps);
5150
enjoyhint_instance.runScript();
5251
```
5352

54-
55-
Script Configuration
56-
=========
57-
53+
#### Script Configuration
5854
The sequence of steps can be only linear for now. So, the script config is an array. Every element of this array is the config for some step.
5955

60-
Example.
56+
#### Example of script configuration
6157
Highlight some button and after you click on it, highlight some panel:
62-
```
58+
```javascript
6359
var enjoyhint_script_steps = [
6460
{
65-
selector:'.some_btn',//jquery selector
66-
event:'click',
67-
description:'Click on this btn'
61+
selector: '.some_btn',//jquery selector
62+
event: 'click',
63+
description: 'Click on this btn'
6864
},
6965
{
70-
selector:'.some_panel',//jquery selector
71-
event:'click',
72-
description:'Click on this panel'
66+
selector: '.some_panel',//jquery selector
67+
event: 'click',
68+
description: 'Click on this panel'
7369
}
7470
];
7571
```
7672

77-
78-
Properties of the step configuration:
79-
**selector** - jquery selector of the DOM-element, that will be highlighted
80-
**event** - a jquery event that is set for the element defined in the selector. When it fires, the next step is triggered.
81-
**key_code** - key code for any "key*" event. Event fires only if key code of the pressed key is equal to this property.
82-
**event_selector** - if you need to attach an event (that was set in "event" property) to other selector, you can use this one
83-
**description** - description for the highlighted element
84-
**timeout** - delay before the moment, when an element is highlighted
85-
**shape** - shape for highlighting (circle|rect)
86-
**margin** - margin for the highlight shape (for Ex.:10)
87-
**top** - top margin for the shape of "rect" type
88-
**right** - right margin for the shape of "rect" type
89-
**bottom** - bottom margin for the shape of "rect" type
90-
**left** - left margin for the shape of "rect" type
91-
**event_type** - type of event that will get you to the next step(auto|custom|next)
92-
93-
Event Types descriptions:
73+
#### Properties of the step configuration
74+
* `selector` - jquery selector of the DOM-element, that will be highlighted
75+
* `event` - a jquery event that is set for the element defined in the selector. When it fires, the next step is triggered.
76+
* `key_code` - key code for any "key*" event. Event fires only if key code of the pressed key is equal to this property.
77+
* `event_selector` - if you need to attach an event (that was set in "event" property) to other selector, you can use this one
78+
* `description` - description for the highlighted element
79+
* `timeout` - delay before the moment, when an element is highlighted
80+
* `shape` - shape for highlighting (circle|rect)
81+
* `margin` - margin for the highlight shape (for Ex.:10)
82+
* `top` - top margin for the shape of "rect" type
83+
* `right` - right margin for the shape of "rect" type
84+
* `bottom` - bottom margin for the shape of "rect" type
85+
* `left` - left margin for the shape of "rect" type
86+
* `event_type` - type of event that will get you to the next step(auto|custom|next)
87+
88+
#### Event Types descriptions:
9489
**auto** - for example, you need to click on the same button on the second step imediatelly after the first step and go to the next step after it. Then you can use "auto" in the "event_type" property and "click" in "event" property.
95-
96-
**custom** - this value is very usefull if you need to go to the next step by event in your app code. For example, you want to go to the next step only after some data have been loaded in your application. Then you should use the "custom" event_type and the "trigger" method of the EnjoyHint instance.
97-
```
90+
* `custom` - this value is very usefull if you need to go to the next step by event in your app code. For example, you want to go to the next step only after some data have been loaded in your application. Then you should use the "custom" event_type and the "trigger" method of the EnjoyHint instance.
91+
```javascript
9892
//Example of using custom event_type
9993
$.get('/load/some_data', function(data){
10094
//trigger method has only one argument: event_name.(equal to the value of event property in step config)
10195
enjoyhint_instance.trigger('custom_event_name');
10296
});
10397
```
104-
**next** - when you set value of event_type to "next", you will see the "Next" btn on this step.
105-
106-
98+
* `next` - when you set value of event_type to "next", you will see the "Next" btn on this step.
10799

108-
Methods
109-
=========
110-
**setScript** - set current steps configuration. Arguments: config
111-
**runScript** - run the current script. Has no arguments
112-
**resumeScript** - resume the script from the step where it was stopped. Has no arguments
113-
**getCurrentStep** - returns the current step index
114-
115-
116-
Events
117-
=========
100+
#### Methods
101+
* `setScript` - set current steps configuration. Arguments: config
102+
* `runScript` - run the current script. Has no arguments
103+
* `resumeScript` - resume the script from the step where it was stopped. Has no arguments
104+
* `getCurrentStep` - returns the current step index
118105

106+
#### Events
119107
**Script Events**:
120-
121-
122-
onStart - fires on the first step
123-
onEnd - fires after the last step in script
124-
```
108+
* `onStart` - fires on the first step.
109+
* `onEnd` - fires after the last step in script.
110+
```javascript
125111
var enjoyhint_instance = new EnjoyHint({
126112
onStart:function(){
127113
//do something
128114
}
129115
});
130116
```
131-
132117
**Step Events**:
133-
134-
onBeforeStart - fires before the step is started
135-
136-
```
118+
* `onBeforeStart` - fires before the step is started.
119+
```javascript
137120
var enjoyhint_script_steps = [
138121
{
139122
selector:'.some_btn',//jquery selector
@@ -145,4 +128,3 @@ var enjoyhint_script_steps = [
145128
}
146129
];
147130
```
148-

bower.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "enjoyhint",
3+
"main": "enjoyhint.js",
4+
"version": "1.0.0",
5+
"homepage": "https://github.com/xbsoftware/enjoyhint",
6+
"authors": [
7+
"XB Software"
8+
],
9+
"description": "Web-tool that provides the simplest way to create interactive tutorials and hints.",
10+
"keywords": [
11+
"enjoyhint",
12+
"hint",
13+
"xbs",
14+
"tutorials"
15+
],
16+
"license": "MIT",
17+
"ignore": [
18+
"**/.*",
19+
"node_modules",
20+
"bower_components",
21+
"test",
22+
"tests"
23+
]
24+
}

0 commit comments

Comments
 (0)