tool_usertours/tour

A user tour.

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

Classes

tool_usertours/tour
Tour

Methods

(inner) accessibilityHide()

Source:

Perform accessibility changes for step hidden.

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

(inner) accessibilityShow()

Source:

Perform accessibility changes for step shown.

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

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

Source:

Helper to add a step to the page.

Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

this.

Type
Object

(inner) announceStep(stepConfig) → {Object}

Source:

Helper to announce the step on the page.

Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

this.

Type
Object

(inner) calculateInherittedBackgroundColor(elem) → {String}

Source:

Calculate the inheritted background colour.

Parameters:
Name Type Description
elem jQuery

The element to calculate colour for

Returns:

Calculated background colour

Type
String

(inner) calculatePosition(elem) → {String}

Source:

Calculate the inheritted position.

Parameters:
Name Type Description
elem jQuery

The element to calculate position for

Returns:

Calculated position

Type
String

(inner) calculateScrollTop(stepConfig) → {Number}

Source:

Calculate scrollTop.

Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:
Type
Number

(inner) calculateScrollTop(currentStepNode)

Source:

Calculate dialogue position for page middle.

Parameters:
Name Type Description
currentStepNode jQuery

Current step node

(inner) calculateZIndex(elem) → {Number}

Source:

Calculate the inheritted z-index.

Parameters:
Name Type Description
elem jQuery

The element to calculate z-index for

Returns:

Calculated z-index

Type
Number

(inner) checkMinimumRequirements()

Source:

Check that the configuration meets the minimum requirements.

(inner) configure(config) → {Object}

Source:

Prepare tour configuration.

Parameters:
Name Type Description
config Object

The configuration object.

Returns:

this.

Type
Object

(inner) endTour() → {Object}

Source:

End the current tour.

Fires:
Returns:

this.

Type
Object

(inner) getCurrentStepNumber() → {Number}

Source:

Retrieve the current step number.

Returns:

The current step number

Type
Number

(inner) getNextStepNumber(stepNumber) → {Number}

Source:

Get the next step number after the currently displayed step.

Parameters:
Name Type Description
stepNumber Number

The current step number

Returns:

The next step number to display

Type
Number

(inner) getPreviousStepNumber(stepNumber) → {Number}

Source:

Get the previous step number before the currently displayed step.

Parameters:
Name Type Description
stepNumber Number

The current step number

Returns:

The previous step number to display

Type
Number

(inner) getStepConfig(stepNumber) → {Object}

Source:

Fetch the normalised step configuration for the specified step number.

Parameters:
Name Type Description
stepNumber Number

The step number to fetch configuration for

Returns:

The step configuration

Type
Object

(inner) getStepContainer() → {jQuery}

Source:

Return the current step node.

Returns:
Type
jQuery

(inner) getStepTarget(stepConfig) → {$}

Source:

Fetch the actual step target from the selector.

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

Parameters:
Name Type Description
stepConfig Object

The step configuration

Returns:
Type
$

(inner) getTemplateContent() → {$}

Source:

Getter for the template content.

Returns:
Type
$

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

Source:

Go to the specified step in the tour.

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)

Source:

Handle key down events.

Parameters:
Name Type Description
e EventFacade

(inner) hide(transition) → {Object}

Source:

Hide any currently visible steps.

Parameters:
Name Type Description
transition Bool

Animate the visibility change

Fires:
Returns:

this.

Type
Object

(inner) init(config) → {Object}

Source:

Initialise the tour.

Parameters:
Name Type Description
config Object

The configuration object.

Returns:

this.

Type
Object

(inner) isLastStep(stepNumber) → {Boolean}

Source:

Is the step the final step number?

Parameters:
Name Type Description
stepNumber Number

Step number to test

Returns:

Whether the step is the final step

Type
Boolean

(inner) isStepActuallyVisible(stepConfig) → {Boolean}

Source:

Is this step actually visible?

Parameters:
Name Type Description
stepConfig Object

The step configuration to normalise

Returns:

Whether the step is actually visible

Type
Boolean

(inner) isStepPotentiallyVisible(stepConfig) → {Boolean}

Source:

Is this step potentially visible?

Parameters:
Name Type Description
stepConfig Object

The step configuration to normalise

Returns:

Whether the step is the potentially visible

Type
Boolean

(inner) next() → {Object}

Source:

Go to the next step in the tour.

Returns:

this.

Type
Object

(inner) normalizeStepConfig(stepConfig) → {Object}

Source:

Normalise the supplied step configuration.

Parameters:
Name Type Description
stepConfig Object

The step configuration to normalise

Returns:

The normalised step configuration

Type
Object

(inner) positionBackdrop(stepConfig) → {Object}

Source:

Add the backdrop.

Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

this.

Type
Object

(inner) positionStep(stepConfig) → {Object}

Source:

Position the step on the page.

Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

this.

Type
Object

(inner) previous() → {Object}

Source:

Go to the previous step in the tour.

Returns:

this.

Type
Object

(inner) processStepListeners(stepConfig) → {Object}

Source:

Process listeners for the step being shown.

Parameters:
Name Type Description
stepConfig object

The configuration for the step

Returns:

this.

Type
Object

(inner) recalculatePlacement(stepConfig) → {String}

Source:

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'.

Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

The placement after recalculate

Type
String

(inner) renderStep(stepConfig) → {Object}

Source:

The standard step renderer.

Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

this.

Type
Object

(inner) reset() → {Object}

Source:

Reset the current tour state.

Returns:

this.

Type
Object

(inner) resetStepDefaults(loadOriginalConfiguration) → {Object}

Source:

Reset step default configuration.

Parameters:
Name Type Description
loadOriginalConfiguration Boolean

Whether to load the original configuration supplied with the Tour.

Returns:

this.

Type
Object

(inner) resetStepListeners() → {Object}

Source:

Reset step listeners.

Returns:

this.

Type
Object

(inner) restartTour() → {Object}

Source:

Restart the tour from the beginning, resetting the completionlag.

Returns:

this.

Type
Object

(inner) revealStep(stepConfig) → {Object}

Source:

Make the given step visible.

Parameters:
Name Type Description
stepConfig Object

The step configuration of the step

Returns:

this.

Type
Object

(inner) setCurrentStepNumber(stepNumber)

Source:

Store the current step number.

Parameters:
Name Type Description
stepNumber Number

The current step number

(inner) setStepDefaults(stepDefaults) → {Object}

Source:

Set the step defaults.

Parameters:
Name Type Description
stepDefaults Object

The step defaults to apply to all steps

Returns:

this.

Type
Object

(inner) show() → {Object}

Source:

Show the current steps.

Returns:

this.

Type
Object

(inner) startTour(startAt) → {Object}

Source:

Start the current tour.

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

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>