Giter Site home page Giter Site logo

anno.js's People

Contributors

iamdanfox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anno.js's Issues

Conditional tour steps

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:

  1. You can search like this
  2. ** Wait for condition $(".results-panel .result-item").length > 0 **
  3. Continue with annotations on results

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.

Data-driven Annotations

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.

Serious BUG: Clicking fast on next causes anno.js to malfunction

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?

image

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.

CoffeeScript source isn't in repo

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.

switchChainToNext() on $target event

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

NextButton cause jquery validation fired

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?

IE 10 vs IE 11

Hi, the anno.js is working fine in IE 11 but it is not working when I switch IE 10. Is there compatibility limitation?

clicking outside doesn't close annojs

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?

Unable to set parent element of overlay

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!

Multipage tour

Hi,

I'm wondering how to set a tour for a multipage website, do you have any ideas ?

Thanks a lot.

Fix: button type should set to button

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

Invalid jQuery require

The valid npm package name here is jquery:

module.exports = factory(require("jQuery"));

Otherwise bundlers fail to compile.

Static Backdrop

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

Event for tour dismissed

I need to know if a tour has been dismissed, rather than just a single anno step being hidden.

Is this possible?

Unable to place border on .anno anno-arrow

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;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.