new SPA( details )

Description

A userscript driver for working with a Single-Page Application.

In many cases, as a user navigates through a SPA, the website will change the URL. This allows for easy bookmarking by users. By monitoring the changes to the URL, this class facilitates making userscripts that adapt to different views.

Generally, a single instance of this class is created, and all Page subclasses are registered with it. As the user navigates through the SPA, this class will react to the changes and enable and disable view specific Pages as appropriate.

Each Page can be customized to augment the individual site page.

Parameters
Name Type Description
details NexusHoratio.spa.Details

Implementation specific details.

Details

Members


details :NexusHoratio.spa.Details

Methods


Symbol.dispose()

Description

Dispose of the instance.

Details

register( Klass ) → {NexusHoratio.spa.SPA}

Description

Add a new page to those supported by this instance.

Parameters
Name Type Description
Klass NexusHoratio.spa.Page

A NexusHoratio.spa.Page class to instantiate.

Returns

This instance, for chaining.

Details

Type Definitions


Pages

Properties
Name Type Description
active Set.<NexusHoratio.spa.Page>

Currently active pages.

old Set.<NexusHoratio.spa.Page>

Pages being deactivated.

new Set.<NexusHoratio.spa.Page>

Pages being activated.

Details
object

Events


activate

Details

activated

Details

initialize

Details

initialized

Details