Skip to content

Commit c8fa053

Browse files
committed
Merge branch 'master' of https://github.com/xbsoftware/enjoyhint
2 parents a52877a + a64f67e commit c8fa053

File tree

1 file changed

+53
-23
lines changed

1 file changed

+53
-23
lines changed

README.md

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ EnjoyHint
44

55
EnjoyHint is free software distributed under the terms of MIT license.
66

7-
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))
7+
#### Demo
8+
* [TODO app demo](http://xbsoftware.github.io/enjoyhint/) ([downloadable package](http://xbsoftware.github.io/enjoyhint/enjoyhint_todo_demo.zip))
9+
* [A small guide on EnjoyHint](http://xbsoftware.github.io/enjoyhint/example1.html)
810

911
#### Dependencies
1012
EnjoyHint require the following plugins and libs:
@@ -37,17 +39,15 @@ var enjoyhint_instance = new EnjoyHint({});
3739
//hide EnjoyHint after a click on the button.
3840
var enjoyhint_script_steps = [
3941
{
40-
selector:'.new_btn',//jquery selector
41-
event:'click',
42-
description:'Click the "New" button to start creating your project'
42+
'click .new_btn' : 'Click the "New" button to start creating your project'
4343
}
4444
];
4545

4646
//set script config
47-
enjoyhint_instance.setScript(enjoyhint_script_steps);
47+
enjoyhint_instance.set(enjoyhint_script_steps);
4848

4949
//run Enjoyhint script
50-
enjoyhint_instance.runScript();
50+
enjoyhint_instance.run();
5151
```
5252

5353
#### Script Configuration
@@ -58,34 +58,44 @@ Highlight some button and after you click on it, highlight some panel:
5858
```javascript
5959
var enjoyhint_script_steps = [
6060
{
61-
selector: '.some_btn',//jquery selector
62-
event: 'click',
63-
description: 'Click on this btn'
61+
'click .some_btn' : 'Click on this btn'
6462
},
6563
{
66-
selector: '.some_panel',//jquery selector
67-
event: 'click',
68-
description: 'Click on this panel'
64+
'click .some_panel' : 'Click on this panel'
6965
}
7066
];
7167
```
7268

7369
#### 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.
70+
* `"event selector" : "description"` - to describe a step you should set an event type, selecte element and add description for this element (hint)
71+
* `keyCode` - the code of a button, which triggers the next EnjoyHint step upon a click. Defined by the “key” event. (“key #block” : “hello”).
7772
* `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
7973
* `timeout` - delay before the moment, when an element is highlighted
80-
* `shape` - shape for highlighting (circle|rect)
74+
* `shape` - shape for highlighting (circle|rect)
75+
* `radius` - if the shape of "circle" is specified, we can set the radius.
8176
* `margin` - margin for the highlight shape (for Ex.:10)
8277
* `top` - top margin for the shape of "rect" type
8378
* `right` - right margin for the shape of "rect" type
8479
* `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)
80+
* `left` - left margin for the shape of "rect" type
81+
* `scrollAnimationSpeed` - sets the auto scroll speed (ms).
82+
* `nextButton` - allows applying its classes and names for the button Nеxt.
83+
* `skipButton` - allows applying its classes and names for the button Skip. For the example :
84+
```javascript
85+
var options = {
86+
"next #block": 'Hello.',
87+
"nextButton" : {className: "myNext", text: "NEXT"},
88+
"skipButton" : {className: "mySkip", text: "SKIP"},
89+
90+
}
91+
```
92+
* `showSkip` - shows or hides the Skip button (true|false)
93+
* `showNext` - shows or hides the Next button (true|false)
94+
8795

88-
#### Event Types descriptions:
96+
97+
98+
#### Non-standard events:
8999
**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.
90100
* `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.
91101
```javascript
@@ -96,11 +106,13 @@ $.get('/load/some_data', function(data){
96106
});
97107
```
98108
* `next` - when you set value of event_type to "next", you will see the "Next" btn on this step.
109+
* `key` - tells EnjoyHint to go to the next step when you click on the button defined by the keyCode
110+
99111

100112
#### 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
113+
* `set` - set current steps configuration. Arguments: config
114+
* `run` - run the current script. Has no arguments
115+
* `resume` - resume the script from the step where it was stopped. Has no arguments
104116
* `getCurrentStep` - returns the current step index
105117

106118
#### Events
@@ -128,3 +140,21 @@ var enjoyhint_script_steps = [
128140
}
129141
];
130142
```
143+
144+
#### Release notes
145+
146+
##### v.3
147+
148+
* New and simplified description of EnjoyHint steps
149+
* Auto scroll to the element
150+
* Possibility to hide or display the buttons showNext, showSkip.
151+
* HTML usage allowed in description
152+
* Destructor
153+
* Simplified property names
154+
* Grunt to compress and merge files
155+
* New examples
156+
* You can learn the step you are on by the class enjoyhint-step-* ( where * stands for the step number).
157+
158+
159+
160+

0 commit comments

Comments
 (0)