iamdanfox / anno.js Goto Github PK
View Code? Open in Web Editor NEWInteractive step-by-step guides for web apps.
Home Page: iamdanfox.github.io/anno.js/
License: MIT License
Interactive step-by-step guides for web apps.
Home Page: iamdanfox.github.io/anno.js/
License: MIT License
This would make generating a nice annotated source very easy.
It'd be great if you could specify a set of conditions for each tour step, and when the tour reaches that step it effectively pauses until those conditions are met.
eg:
At the moment this is achieved by splitting up the tour into lots of little tours, and then triggering them from the right places, but it sort of makes my code a bit messy :)
In this way I can write a really clean tour that guides a user through a set of actions on the app, which is useful if they're learning to use it for the first time.
Rather than writing up my tour annotations separately from my content, it would be great if the annotation content could be co-located with the target elements. This way, if I need to refactor the code in future it'll be more obvious that I also need to change the tour annotations.
Would also need to include tour step order definition as well.
Tour data could then be aggregated and run accordingly.
Would allow a simpler usage section:
npm install annojs
Clicking fast and multiple times on the Next button causes AnnoJs to misbehave (dosn't closes the dialogs) and this error is reported:
Can't hideAnno() for '" + this.target + "' when @_annoElem ") + "is null. Did you call hideAnno() twice?
I managed to reproduce it in the official example click next/back fast / multiple times.
Quick Fix is to remove the transition in .anno {} and to remove the setTimeout to remove an item in hideAnno().
A proper fix would be probably to animate it with JQuery and wait until the transition is done before opening the new one and closing the existing, another to make the steps async or to spend more time timing the animation and the steps but feels kind of hacky because it depends on too many things.
I can do a proper fix if pull requests are still reviewed.
UX of http://iamdanfox.github.io/anno.js/ is currently pretty bad on an iPhone
When the NextButton is clicked on the annotation, it submits the form if the target's parent is a form. How do I stop this?
Matches intro.js behaviour...
When targeting an element within a vertically scrollable div, Anno.js does not scroll to the correct position. Effectively the annotation can not be seen at all in a full webpage.
See fiddle here (here you can scroll to find the annotation):
http://jsfiddle.net/xgn12yzx/2/
There is an anno.js
file that indicates it was built by CoffeeScript but no source file can be found in the repo. Is Anno.js coded in CoffeeScript or JavaScript? I don't want to make changes to the anno.js
file if it is an output and not the source.
Specify no transition duration for left
or top
, and just animate margin
to provide a nice slide?
The Anno element fades in as it transitions from top:0,left:0 to whatever the specified position is.
This also degrades the scrolling experience!
When using anno.js to guide the user through using a web-app interface, it's sometimes preferable to show the next annotation when a certain event occurs on the interface (eg: next when $target element is clicked, keypress occurs, DOMNodeInserted etc)
To achieve this currently, handlers are added in onshow/onhide. Although it's certainly possible to work this way, it does result in a lot of ctrl + c, ctrl + v code
Vanilla eg:
target: ".confirm"
position: "top"
content: "Press <code>confirm</code> to continue"
buttons: []
onShow: (anno, $target, $annoElem) ->
handler = ->
anno.switchToChainNext()
$target.on "click", handler
return handler
onHide: (anno, $target, $annoElem, handler) ->
$target.unbind "click", handler
Complicated eg:
target: "#attribute-common-class"
position: "bottom"
content: "Click the <code>tag token</code> below to continue"
buttons: []
onShow: (anno, $target, $annoElem) ->
handler = ->
setTimeout -> #allow angular digest cycle to run first
anno.switchToChainNext()
, 10
$target.find(".tags_token").on "mouseup", handler
return handler
onHide: (anno, $target, $annoElem, handler) ->
$target.find(".tags_token").unbind "mouseup", handler
It'd be great if anno.js had some additional properties to hook into, eg:
event: "click"
eventTarget: ".clickTarget" #default to $target if not specified
eventHandler: -> #default to anno.switchToChainNext() if not specified.
#in addition to custom handlers, also provide annoEvent.Back(), .Next() and .Close() as pre-configured handlers
setTimeout ->
anno.switchToChainNext()
, 10
Hi,
My web page contains some form elements and i want to use Anno.js to guide my visitors.But after first textbox, Anno.js cause form validation.
There is not any event that could be trigger validation.
After this step validation fired
{
target: '#title', // second block of code
position: 'bottom',
content: 'Write your title here',
buttons: [AnnoButton.NextButton]
}
Do you have any suggestion?
Clicking the default tour button fires the click event on containing elements, which isn't ideal.
Hi, the anno.js is working fine in IE 11 but it is not working when I switch IE 10. Is there compatibility limitation?
v0.2.0 release, downloadable as a zip file.
Mention overall size gzipped and minified (~ 5KB as of writing).
... if the target is already on the left of the viewport, (e.g. on iPhones).
Users shouldn't specify these off-screen position
s, but perhaps we should put a warning/error on the console?
In the last step of our tour, we have a custom button that opens up a modal and closes annojs, however if you do not click on that button (i.e. if you click somewhere outside of annojs), annojs remains open. In any other step except for the last one, annojs will close if you click outside of it. Is there something I"m overlooking?
http://iamdanfox.github.io/anno.js/ Size&Positioning section
This makes an arbitrary rectangle clickable instead of the button
... this leads to inconsistent overlays.
Replace litera's plugin with this one: https://github.com/Arwid/jQuery.scrollIntoView. This seems to allow multiple targets.
Do anno fadeout first, then hide overlay.
Maybe use promises/callbacks?
For my application I needed to set the parent of the overlay to an element deeper in my tree than body due to some absolute/relative positioning madness messing up my z-indexes. The request is to replace the $('body') call in showOverlay() with a configurable property. Thanks!
Evaluate using jQuery UI position...
http://api.jqueryui.com/position/
Hi,
I'm wondering how to set a tour for a multipage website, do you have any ideas ?
Thanks a lot.
in AnnoButton.prototype.buttonElem you should do a little fixation:
return $("<button type='button' class='anno-btn'></button>").html(this.textFn(anno)).addClass(this.className).click((function(_this) { return function(evt) { return _this.click.call(anno, anno, evt); }; })(this));
it should be like this, otherwise it submit the form when click next or done
(to demonstrate the scrollintoview functionality)
The valid npm package name here is jquery
:
module.exports = factory(require("jQuery"));
Otherwise bundlers fail to compile.
How to prevent the Anno hide or disssapear when is clicked outside?
I just created an Anno that contain 4 guide dialog. I change some css code when 1st dialog onShow, then set them back when the last dialog onHide.
My problem is, when me (is on second or third dialog) click outside the dialog, Anno will dissapear but my css is not set back yet. how can I prevent anno from hide or dissapear when i click outside the dialog, or maybe u have another good way/ event to change my css when anno dissapear
I need to know if a tour has been dismissed, rather than just a single anno step being hidden.
Is this possible?
Publish a prominent link on README.md.
Make it smoother. Maybe use transforms or that translation hack to engage the GPU. (Try to get first click smoother!)
CSS: 'center top'
Anno: 'center-top'
CSS: 'left top'
Anno: 'top'
I would like to place a border around the anno-inner div and around the anno-arrow so that it's one big anno guide border.
.anno .anno-arrow {
position: absolute;
border: 12px solid white;
}
.anno.anno-target-center-left .anno-arrow,
.anno.anno-target-left .anno-arrow {
right: 100%;
top: 15px;
border-left: none;
border-color: transparent white;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.