Simple, flexible tours for your app

Overview

Tourist.js Build Status

Tourist.js is a simple library for creating guided tours through your app. It's better suited to complex, single-page apps than websites. One of our main requirements was the ability to control the interface for each step. For example, a step in the tour might need to open a window or menu to work correctly. Tourist gives you hooks to do this.

Basically, you specify a series of steps which explain elements to point at and what to say. Tourist.js manages moving between those steps.

Install

The code is available via bower install tourist. Once you have the code, you just need to include the javascript file. An optional CSS file with minimal styling is included as well.

<script src="tourist.js"></script>

<!-- Optional! -->
<link rel="stylesheet" href="tourist.css" type="text/css" media="screen">

Dependencies

Tourist depends on Backbone and jQuery. jQuery UI is optional. Tourist uses an easing function from jQuery UI if present in the show effect with the Bootstrap tip implementation.

Tourist comes with the ability to use either Bootstrap 3 popovers (default) or QTip2 tips, so you'll need either Bootstrap 3 CSS (only the CSS is necessary!) or QTip2 installed. You can write your own tooltip connector if you'd like.

Basic Usage

Making a simple tour is easy:

var steps = [{
  // this is a step object
  content: '<p>Hey user, check this out!</p>',
  highlightTarget: true,
  nextButton: true,
  target: $('#thing1'),
  my: 'bottom center',
  at: 'top center'
}, {
  ...
}, ...]

var tour = new Tourist.Tour({
  steps: steps,
  tipOptions:{ showEffect: 'slidein' }
});
tour.start();

Reference

Tour object

Create one like this:

var steps = [{...}, {...}]
var tour = new Tourist.Tour({
  steps: steps
});
tour.start();

Options

  • steps a collection of step objects
  • stepOptions an object of options to be passed to each function called on a step object, notably the setup() and teardown() functions
  • tipClass the class from the Tourist.Tip namespace to use. Defaults to Bootstrap, you can use QTip if you have QTip2 installed
  • tipOptions an options object passed to the tipClass on creation
  • cancelStep step object for a step that runs if user hits the close button.
  • successStep step object for a step that runs last when they make it all the way through.

Methods

  • start() will start the tour. Can be used to restart a stopped tour
  • stop(doFinalStep) will stop the tour. doFinalStep is a bool; true will run the cancelStep specified in the options (if it's specified).
  • next() move to the next step

The step object

The 'step object' is a simple javascript object that specifies how a step will behave.

A simple Example of a step object:

{
  content: '<p>Welcome to my step</p>',
  target: $('#something-to-point-at'),
  closeButton: true,
  highlightTarget: true,
  setup: (tour, options) {
    // do stuff in the interface/bind
  },
  teardown: function(tour, options) {
    // remove stuff/unbind
  }
}

Step object options

  • content a string of html to put into the step.
  • target jQuery object or absolute point: [10, 30]
  • highlightTarget optional bool, true will add the class tour-highlight to the target. If tourist.css is included, it will outline the target with a bright color.
  • container optional jQuery element that should contain the step flyout. default: $('body')
  • viewport optional jQuery element that the step flyout should stay within. $(window) is commonly used. default: false
  • zIndex optional string or number z-index value for the tip. If not specified, will use value specified in css (or base tip implementation in case of QTip2 tips). Value set on prev step will not affect later steps.
  • my string position of the pointer on the tip. default: 'left center'
  • at string position on the element the tip points to. default: 'right center' see http://craigsworks.com/projects/qtip2/docs/position/#basics
  • okButton optional bool, true will show a 'primary' ok button
  • closeButton optional bool, true will show a close button in the top right corner
  • skipButton optional bool, true will show a 'secondary' skip button
  • nextButton optional bool, true will show a 'primary' next button
  • setup optional function called before the tip is shown; see setup section
  • teardown optional function called when the tour moves to the next step; see teardown section
  • bind optional list of function names to bind; see bind section

Step object function options

All functions on the step will have the signature function(tour, options){} where

  • tour is the Draw.Tour object. Handy to call tour.next()
  • options is the step options. An object passed into the tour when created. It has the environment that the fns can use to manipulate the interface, bind to events, etc. The same object is passed to all of a step object's functions, so it is handy for passing data between steps.

setup()

setup() is called before a step is shown. Use it to scroll to your target, hide/show things, etc.

this is the step object itself.

setup() can return an object. Properties in the returned object will override properties in the step object.

Example, the target might be dynamic so you would specify:

{
  setup: function(tour, options) {
    options.model.bind('change:thing', this.onThingChange);
    return { target: $('#point-to-me') };
  }
}

teardown()

teardown() will be called right before hiding the step. Use to unbind from things you bound to in setup().

this is the step object itself.

{
  teardown: function(tour, options) {
    options.model.unbind('change:thing', this.onThingChange);
  }
}

Return nothing from teardown()

bind

bind is an array of function names to bind. Use this for event handlers you use in setup().

Will bind functions to the step object as this, and the first 2 args as tour and options. i.e.

{
  bind: ['onChangeSomething'],
  onChangeSomething: function(tour, options, model, value) {
    tour.next()
  },
  setup: function(tour, options) {
    options.document.bind('change:something', this.onChangeSomething);
    return {};
  },
  teardown: function(tour, options) {
    options.document.unbind('change:something', this.onChangeSomething)
  }
}

Tip objects

You won't be creating Tip objects yourself, the Tour object will handle that. But you can choose which tip implementation to use and you can pass the tip options to use on creation.

Bootstrap tips

Bootstrap tips are the default tip. They use only the markup and CSS from Bootstrap. Bootstrap's javascript for tooltips or popovers is not necessary. Here's how to use them.

var tour = new Tourist.Tour({
  steps: steps,
  tipClass: 'Bootstrap'
  tipOptions: {
    showEffect: 'slidein'
  }
});

It supports some options you can specify in tipOptions:

  • showEffect a string effect name
  • hideEffect a string effect name

Only one effect is defined at this time: slidein. And you need to include jQuery UI to get the proper easing function for it.

Effects are specified as functions on Tourist.Tip.Bootstrap.effects take a look at the implementation for an existing effect to get an idea how to extend.

QTip2 tips

An alternative is to use QTip2 tips. You need to include both the QTip javascript and CSS for these to work.

var tour = new Tourist.Tour({
  steps: steps,
  tipClass: 'QTip'
  tipOptions: {
    ...
  }
});

Options accepted are any options QTip supports and in their format.

Your own Tip implementation

You can use your own tip implementation if you want. Make a class and hang it off the Tourist.Tip namespace. See the tips code for examples. The bootstrap example is probably most interesting. Here is a basic example in coffeescript:

# you need to provide these implementations at a minimum
class Tourist.Tip.MyTip extends Tourist.Tip.Base
  initialize: (options) ->
    # options would be: { likes: ['turtles'] }
    $('body').append(@el)

  show: ->
    @el.show()

  hide: ->
    @el.hide()

  _getTipElement: ->
    @el

  # Jam the content into our element
  _renderContent: (step, contentElement) ->
    @el.html(contentElement)

tour = new Tourist.Tour
  steps: steps
  tipClass: 'MyTip'
  tipOptions: { likes: ['turtles'] }

Testing/Building

  • Requires grunt npm install -g grunt-cli
  • Install grunt modules npm install
  • Automatically compile changes grunt watch
  • Run tests with grunt grunt test

Browser support

Officially tested on latest Firefox and Chrome

Structure

  • /test/src - coffeescript jasmine tests
  • /test/suite - runs the tests
  • /src - coffeescript
  • tourist.js - generated js

Contributing

  • Adhere to our styleguide
  • Send a pull request.
  • Write tests. New untested code will not be merged.

Release History

  • major.minor.patch: yyyy.mm.dd - description
  • 0.0.12: 2013-06-12 - add zIndex step object option

MIT License

Comments
  • Keyboard navigation?

    Keyboard navigation?

    I didn't look into the code, but what I noticed from your demo is, that you cannot use your keyboard arrows to navigate. Maybe it's just turned of in your demo?, but if not, this is something that is really missing...

    opened by marczking 6
  • Prevent popover from closing on body click.

    Prevent popover from closing on body click.

    Recently been trying to detect if the user clicks out of the tour by clicking outside of the popover to let them know that they can restart the tour.

    I was unable to find a way to:

    1. Detect when the user accidentally closed the popover
    2. Keep the popover from closing when clicking outside the popover

    Is that functionality built in or is that something that isn't possible?

    Thanks!

    opened by scottcorgan 3
  • Added Keyboard Commands

    Added Keyboard Commands

    Keyboard commands are implemented into tourist. Some features:

    • Configurable (multiple keys allowed) for next and cancel tour
    • Will only advance if "next" button is shown
    • Jasmine specs written and tested
    opened by lezed1 3
  • CloseButton does not work

    CloseButton does not work

    I set the value for closeButton = true in all of my steps, but the close button doesn't show, and the user can't close the turorial until the end, Am I wrong with something?

    2015-08-12_1414

    opened by olman21 1
  • Don't overwrite default styling for Bootstrap popovers

    Don't overwrite default styling for Bootstrap popovers

    Currently tourist.css is overwriting the default styling of bootstrap popovers.

    This breaks the design of the popovers which are used without tourist. Especially the line which removes the default padding is causing issues, as it's non-specific.

    Instead I propose that the popovers generated by tourist should be created with a tourist-popover class, and all styling should be applied to only these popovers.

    opened by DanielApt 1
  • Update bower deps and update npm package.json

    Update bower deps and update npm package.json

    Just a general tidy up. The main reason for adding backbone to the bower dependancies is if someone is using concatenation (I am using gulp-concat), then its likely that Backbone as a dependancy will be placed after tourist causing errors in the final script.

    As part of this I've bumped the version number as well :-)

    opened by chriswiggins 1
  • Dependency on backboneJS

    Dependency on backboneJS

    I am looking to use this for my meteorJS based application which technically isn't an SPA but I am wondering if backbone is a hard set requirement, I am trying to avoid adding a dependency to it and still use this package if possible ?

    opened by wbashir 1
  • Would it be possible to have a build with only the base tip ?

    Would it be possible to have a build with only the base tip ?

    I think the basic build should not include Bootstrap and QTip. In almost every use case, you'll only use one of them and the other will be loaded and never used. Solutions:

    • Create a simple build with only the base logic and let the developer include its own custom tip (or use onle Bootstrap or QTip)
    • Creates one build with everything (the current one)

    Your thoughts ?

    opened by QuentinFchx 1
  • Update tourist.js to fix '..' being prepended to all tour tips.

    Update tourist.js to fix '..' being prepended to all tour tips.

    For some reason, when using QTip, Tourist is appending my own content text for each tour-step to this default. So all tooltips had '..' before my own content. Not sure why this default is being used, so let's remove it?

    opened by infernocloud 1
  • Use tourist-popover class

    Use tourist-popover class

    This addresses #32.

    I've not written any tests, as this doesn't change the functionality of the product.

    I'm also not sure if you wanted the updated src files to be included, but in this PR I have included them.

    opened by DanielApt 0
  • Vmeyet/fix teardown multiple call at the end

    Vmeyet/fix teardown multiple call at the end

    This is what @vmeyet and me come up with. We removed the _teardownCurrentStep method and we make sure we call the teardown only before rendering the next step

    opened by QuentinFchx 0
  • option to set the next button text

    option to set the next button text

    Add support to set the next button text of each step.

    This is a pretty basic option that I can't find on the documentation. Also this is needed to support I18N provided by the system.

    opened by ppazos 6
  • TypeError: undefined is not a constructor

    TypeError: undefined is not a constructor

    TypeError: undefined is not a constructor (evaluating 'new Tourist.Tip[this.options.tipClass](tipOptions)')

    The example website works form me but for some reason when I moved it over and added more steps it was not working anymore.

    opened by CosmicWebServices 1
  • What is the status of tourist?

    What is the status of tourist?

    With the shut down of easel, what is the status of this project? There doesn't seem to be much active development. Is there a development community still active behind this?

    opened by sambao21 9
  • Multilingual support

    Multilingual support

    At the moment, the buttons and step-counter are English only, because it's hardcoded at https://github.com/easelinc/tourist/blob/master/tourist.js#L45 .

    Would you mind making this a setting?

    opened by bondt 1
  • teardown for last step is called 3 times

    teardown for last step is called 3 times

    in next https://github.com/easelinc/tourist/blob/master/src/tour.coffee#L141 in showFinalStep https://github.com/easelinc/tourist/blob/master/src/tour.coffee#L206 in stop https://github.com/easelinc/tourist/blob/master/src/tour.coffee#L193

    Not sure how we can fix that. Deleting the callback after using it does not look right. Given the current state, I guess a small revamp of the flow is necessary here.

    opened by QuentinFchx 2
A framework to make it easy for developers to add product tours to their pages.

?? UNMAINTAINED ?? This project is no longer used by LinkedIn and is currently unmaintained. Hopscotch Hopscotch is a framework to make it easy for de

LinkedIn's Attic 4.2k Jan 4, 2023
Guide your users through a tour of your app

Shepherd is maintained by Ship Shape. Contact us for web app consulting, development, and training for your project. Browsers support Edge Firefox Chr

Ship Shape 10.8k Dec 28, 2022
Simple overlay instructions for your apps.

Chardin.js Simple overlay instructions for your apps. Check out a demo. Or demo sequential stepping. Chardin.js is a jQuery plugin that creates a simp

Pablo Fernandez 5k Jan 5, 2023
A better way for new feature introduction and step-by-step users guide for your website and project.

Intro.js v3 Lightweight, user-friendly onboarding tour library Where to get You can obtain your local copy of Intro.js from: 1) This github repository

usablica 21.7k Jan 2, 2023
Simple, flexible tours for your app

Tourist.js Tourist.js is a simple library for creating guided tours through your app. It's better suited to complex, single-page apps than websites. O

null 1.2k Dec 6, 2022
A simple, lightweight, clean and small library for creating guided product tours for your web app.

Tourguide.js Simple, lightweight library for creating guided tours for your web, apps and more. A tour guide is a person who provides assistance, info

Docsie.io 277 Dec 12, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Quick and easy product tours with Twitter Bootstrap Popovers

Bootstrap Tour Quick and easy way to build your product tours with Bootstrap Popovers. Compatible with Bootstrap >= 2.3.0 Demo and Documentation http:

Ulrich Sossou 4.4k Dec 23, 2022
A framework to make it easy for developers to add product tours to their pages.

?? UNMAINTAINED ?? This project is no longer used by LinkedIn and is currently unmaintained. Hopscotch Hopscotch is a framework to make it easy for de

LinkedIn's Attic 4.2k Jan 4, 2023
Create flexible REST endpoints and controllers from Sequelize models in your Express app

Finale Create flexible REST endpoints and controllers from Sequelize models in your Express or Restify app. This project aims to be a Sequelize 4.x an

Tom Juszczyk 181 Oct 18, 2022
Provide solutions to make your app flexible for different screen sizes, different devices.

react-native-size-scaling Provide solutions to make your app flexible for different screen sizes, different devices, based on your device's pixel rati

Hoà Phan 33 Dec 23, 2022
💻 Simple and flexible CLI Tool for your daily JIRA activity (supported on all OSes)

jirax ⭐ If you are using this tool or you like it, Star on GitHub — it helps! A CLI tool for JIRA for day to day usage with JIRA.Speed up your JIRA ac

জুনিপ 56 Oct 4, 2022
ToastmeJS is a very simple, flexible and light weigth plugin that shows Notifications and modal Dialogs on your website.

⚡ ToastmeJS ToastmeJS is a very simple, flexible and light weigth plugin that shows Notifications and modal Dialogs on your website. Customize positio

Alejandro Vivas 8 Jun 20, 2022
🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

downshift ?? Primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components. Read the docs | See

Downshift 11.1k Dec 28, 2022
🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

downshift ?? Primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components. Read the docs | See

Downshift 11.1k Jan 1, 2023
☕️ simple, flexible, fun javascript test framework for node.js & the browser

☕️ Simple, flexible, fun JavaScript test framework for Node.js & The Browser ☕️ Links Documentation Release Notes / History / Changes Code of Conduct

Mocha 21.8k Dec 30, 2022
Simple yet flexible charting Lightning Web Component using Chart.js for admins & developers

Lightning Web Chart.js Component Simple yet flexible charting Lightning Web Component using Chart.js for admins & developers Documentation Getting sta

@SalesforceLabs 109 Dec 9, 2022