Constructor
new PlayerHistory(player)
PlayerHistory constructor
Name | Type | Description |
---|---|---|
player | module:JClicPlayer. | The JClicPlayer associated to this history |
- Source
Members
HistoryElement
Inner class used to store history elements.
- Source
player :module:JClicPlayer.JClicPlayer
The JClicPlayer
object to which this PlayerHistory
belongs
- Source
sequenceStack :Array.<module:PlayerHistory.PlayerHistory#HistoryElement>
This is the main member of the class. PlayerHistory puts and retrieves
on it information about the proects and activities done by the current user.
- Source
testMode :boolean
When in test mode, jumps are only simulated.
- boolean
- Source
Methods
clearHistory()
Removes all elements from sequenceStack
- Source
jumpToSequence(sequence, pathopt, allowReturnopt)
Performs a jump to the specified sequence
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
sequence | string | The | ||
path | string | <optional> | null | When not |
allowReturn | boolean | <optional> | false | When this parameter is |
- Source
pop() → {boolean}
Retrieves the HistoryElement
placed at the top of the
stack (if any) and instructs JClicPlayer
to load it. The obtained effect is to
"rewind" or "go back", usually to an activity that acts as a menu.
- Source
- Type:
- boolean
processJump(ji, allowReturn) → {boolean}
Processes the provided JumpInfo
object, instructing JClicPlayer
to go back,
stop or jump to another point in the sequence.
Name | Type | Description |
---|---|---|
ji | module:bags/JumpInfo. | The object to be processed |
allowReturn | boolean | When this parameter is |
- Source
true
if the jump can be processed without errors,false
otherwise.
- Type:
- boolean
processPopStateEvent(state)
Process the state
object received in a popstate
event
Name | Type | Description |
---|---|---|
state | PlayerHistory#HistoryElement | The previously stored state |
- Source
push()
Adds the current project and activity to the top of the history stack.
- Source
pushBrowserHistory()
Push a new entry on the window.History stack,
only when browserHistory
is true and there is no popstate
event in progress
- Source
storedElementsCount() → {number}
Counts the number of HistoryElement
objects stored insequenceStack
- Source
- Type:
- number