tool_usertours/tour

Description:
  • A user tour.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

A user tour.

Classes

Tour
tool_usertours/tour

Methods

(inner) accessibilityHide()

Description:
  • Perform accessibility changes for step hidden.

    This will remove any newly added aria-hidden="true".

Source:

(inner) accessibilityShow()

Description:
  • Perform accessibility changes for step shown.

    This will add aria-hidden="true" to all siblings and parent siblings.

Source:

(inner) addEventHandler(eventName, handler) → {Object}

Source:
Parameters:
Name Type Description
eventName string

The name of the event to listen for

handler function

The event handler to call

Returns:

this.

Type
Object

(inner) addStepToPage(stepConfig) → {Object}

Description:
  • Helper to add a step to the page.

Source:
Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

this.

Type
Object

(inner) announceStep(stepConfig) → {Object}

Description:
  • Helper to announce the step on the page.

Source:
Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

this.

Type
Object

(inner) calculateInherittedBackgroundColor(elem) → {String}

Description:
  • Calculate the inheritted background colour.

Source:
Parameters:
Name Type Description
elem jQuery

The element to calculate colour for

Returns:

Calculated background colour

Type
String

(inner) calculatePosition(elem) → {String}

Description:
  • Calculate the inheritted position.

Source:
Parameters:
Name Type Description
elem jQuery

The element to calculate position for

Returns:

Calculated position

Type
String

(inner) calculateScrollTop(stepConfig) → {Number}

Description:
  • Calculate scrollTop.

Source:
Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:
Type
Number

(inner) calculateScrollTop(currentStepNode)

Description:
  • Calculate dialogue position for page middle.

Source:
Parameters:
Name Type Description
currentStepNode jQuery

Current step node

(inner) calculateZIndex(elem) → {Number}

Description:
  • Calculate the inheritted z-index.

Source:
Parameters:
Name Type Description
elem jQuery

The element to calculate z-index for

Returns:

Calculated z-index

Type
Number

(inner) checkMinimumRequirements()

Description:
  • Check that the configuration meets the minimum requirements.

Source:

(inner) configure(config) → {Object}

Description:
  • Prepare tour configuration.

Source:
Parameters:
Name Type Description
config Object

The configuration object.

Returns:

this.

Type
Object

(inner) endTour() → {Object}

Description:
  • End the current tour.

Source:
Fires:
Returns:

this.

Type
Object

(inner) getCurrentStepNumber() → {Number}

Description:
  • Retrieve the current step number.

Source:
Returns:

The current step number

Type
Number

(inner) getNextStepNumber(stepNumber) → {Number}

Description:
  • Get the next step number after the currently displayed step.

Source:
Parameters:
Name Type Description
stepNumber Number

The current step number

Returns:

The next step number to display

Type
Number

(inner) getPreviousStepNumber(stepNumber) → {Number}

Description:
  • Get the previous step number before the currently displayed step.

Source:
Parameters:
Name Type Description
stepNumber Number

The current step number

Returns:

The previous step number to display

Type
Number

(inner) getStepConfig(stepNumber) → {Object}

Description:
  • Fetch the normalised step configuration for the specified step number.

Source:
Parameters:
Name Type Description
stepNumber Number

The step number to fetch configuration for

Returns:

The step configuration

Type
Object

(inner) getStepContainer() → {jQuery}

Description:
  • Return the current step node.

Source:
Returns:
Type
jQuery

(inner) getStepTarget(stepConfig) → {$}

Description:
  • Fetch the actual step target from the selector.

    This should not be called until after any delay has completed.

Source:
Parameters:
Name Type Description
stepConfig Object

The step configuration

Returns:
Type
$

(inner) getTemplateContent() → {$}

Description:
  • Getter for the template content.

Source:
Returns:
Type
$

(inner) gotoStep(stepNumber, direction) → {Object}

Description:
  • Go to the specified step in the tour.

Source:
Parameters:
Name Type Description
stepNumber Number

The step number to display

direction Number

Next or previous step

Fires:
Returns:

this.

Type
Object

(inner) handleKeyDown(e)

Description:
  • Handle key down events.

Source:
Parameters:
Name Type Description
e EventFacade

(inner) hide(transition) → {Object}

Description:
  • Hide any currently visible steps.

Source:
Parameters:
Name Type Description
transition Bool

Animate the visibility change

Fires:
Returns:

this.

Type
Object

(inner) init(config) → {Object}

Description:
  • Initialise the tour.

Source:
Parameters:
Name Type Description
config Object

The configuration object.

Returns:

this.

Type
Object

(inner) isLastStep(stepNumber) → {Boolean}

Description:
  • Is the step the final step number?

Source:
Parameters:
Name Type Description
stepNumber Number

Step number to test

Returns:

Whether the step is the final step

Type
Boolean

(inner) isStepActuallyVisible(stepConfig) → {Boolean}

Description:
  • Is this step actually visible?

Source:
Parameters:
Name Type Description
stepConfig Object

The step configuration to normalise

Returns:

Whether the step is actually visible

Type
Boolean

(inner) isStepPotentiallyVisible(stepConfig) → {Boolean}

Description:
  • Is this step potentially visible?

Source:
Parameters:
Name Type Description
stepConfig Object

The step configuration to normalise

Returns:

Whether the step is the potentially visible

Type
Boolean

(inner) next() → {Object}

Description:
  • Go to the next step in the tour.

Source:
Returns:

this.

Type
Object

(inner) normalizeStepConfig(stepConfig) → {Object}

Description:
  • Normalise the supplied step configuration.

Source:
Parameters:
Name Type Description
stepConfig Object

The step configuration to normalise

Returns:

The normalised step configuration

Type
Object

(inner) positionBackdrop(stepConfig) → {Object}

Description:
  • Add the backdrop.

Source:
Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

this.

Type
Object

(inner) positionStep(stepConfig) → {Object}

Description:
  • Position the step on the page.

Source:
Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

this.

Type
Object

(inner) previous() → {Object}

Description:
  • Go to the previous step in the tour.

Source:
Returns:

this.

Type
Object

(inner) processStepListeners(stepConfig) → {Object}

Description:
  • Process listeners for the step being shown.

Source:
Parameters:
Name Type Description
stepConfig object

The configuration for the step

Returns:

this.

Type
Object

(inner) recalculatePlacement(stepConfig) → {String}

Description:
  • For left/right placement, checks that there is room for the step at current window size.

    If there is not enough room, changes placement to 'top'.

Source:
Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

The placement after recalculate

Type
String

(inner) renderStep(stepConfig) → {Object}

Description:
  • The standard step renderer.

Source:
Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

this.

Type
Object

(inner) reset() → {Object}

Description:
  • Reset the current tour state.

Source:
Returns:

this.

Type
Object

(inner) resetStepDefaults(loadOriginalConfiguration) → {Object}

Description:
  • Reset step default configuration.

Source:
Parameters:
Name Type Description
loadOriginalConfiguration Boolean

Whether to load the original configuration supplied with the Tour.

Returns:

this.

Type
Object

(inner) resetStepListeners() → {Object}

Description:
  • Reset step listeners.

Source:
Returns:

this.

Type
Object

(inner) restartTour() → {Object}

Description:
  • Restart the tour from the beginning, resetting the completionlag.

Source:
Returns:

this.

Type
Object

(inner) revealStep(stepConfig) → {Object}

Description:
  • Make the given step visible.

Source:
Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

this.

Type
Object

(inner) setCurrentStepNumber(stepNumber)

Description:
  • Store the current step number.

Source:
Parameters:
Name Type Description
stepNumber Number

The current step number

(inner) setStepDefaults(stepDefaults) → {Object}

Description:
  • Set the step defaults.

Source:
Parameters:
Name Type Description
stepDefaults Object

The step defaults to apply to all steps

Returns:

this.

Type
Object

(inner) show() → {Object}

Description:
  • Show the current steps.

Source:
Returns:

this.

Type
Object

(inner) startTour(startAt) → {Object}

Description:
  • Start the current tour.

Source:
Parameters:
Name Type Description
startAt Number

Which step number to start at. If not specified, starts at the last point.

Fires:
Returns:

this.

Type
Object

Type Definitions

StepList

Description:
  • A list of steps.

Source:
Properties:
Name Type Description
stepId Number

The id of the step in the database

position Number

The position of the step within the tour (zero-indexed)

A list of steps.

Type:
  • Array.<Object>