Class: Loader

Loader

new Loader(basePathopt)

todoc
Parameters:
Name Type Attributes Default Description
basePath String <optional>
'/'
Source:

Extends

Members

(static, constant) AUDIO :String

The status of the loader
Properties:
Name Type Description
AUDIO
Type:
  • String
Source:

(static, constant) IMG :String

The status of the loader
Properties:
Name Type Description
IMG
Type:
  • String
Source:

basePath :String

The base path of the loader
Type:
  • String
Default Value:
  • ''
Source:
To Do:
  • implement base path

(readonly) loadQueue :Array

The loading queue of the loader
Type:
  • Array
Default Value:
  • null
Source:

(readonly) setPathList :Array

List of functions to set the queued element's src
Type:
  • Array
Default Value:
  • null
Source:

(readonly) status :String

The status of the loader
Type:
  • String
Default Value:
  • 'pending'
Source:

Methods

add(type, path) → (nullable) {*}

Adds an item to the loading queue
Parameters:
Name Type Description
type String
path String
Source:
Returns:
*

addAudio(path) → {Audio}

Adds an audio to the loading queue
Parameters:
Name Type Description
path String
Source:
Returns:
Audio

addEventListener(type, listener) → {EventTarget}

Adds a listener to the specified event
Parameters:
Name Type Description
type String
listener function
Inherited From:
Source:
Returns:
EventTarget
this

addImage(path) → {Image}

Adds an image to the loading queue
Parameters:
Name Type Description
path String
Source:
Returns:
Image

clear() → {Loader}

Clears the loader
Source:
Returns:
Loader
this

dispatchEvent(type) → {EventTarget}

Dispatches an Event at the specified EventTarget
Parameters:
Name Type Description
type String
Inherited From:
Source:
Returns:
EventTarget
this

eachEventListener(type, callback) → {EventTarget}

Executes a provided function once per event listener
Parameters:
Name Type Description
type String
callback function
Inherited From:
Source:
Returns:
EventTarget
this

emit(type) → {EventTarget}

Dispatches an Event at the specified EventTarget
Parameters:
Name Type Description
type String
Inherited From:
Source:
See:
Returns:
EventTarget
this

hasEventListener(type) → {Boolean}

Determines if the eventTarget has eventListeners of the given type
Parameters:
Name Type Description
type String
Inherited From:
Source:
Returns:
Boolean

load(type, path, callbackopt) → (nullable) {*}

Loads an item
Parameters:
Name Type Attributes Description
type String
path String
callback function <optional>
Source:
Returns:
*

loadAudio(path, callbackopt, autoLoadopt) → {Audio}

Loads an audio
Parameters:
Name Type Attributes Description
path String
callback function <optional>
autoLoad Boolean <optional>
Source:
Returns:
Audio

loadImage(path, callbackopt, autoLoadopt) → {Image}

Loads an image
Parameters:
Name Type Attributes Description
path String
callback function <optional>
autoLoad Boolean <optional>
Source:
Returns:
Image

off(type, listener) → {EventTarget}

Removes a listener from the specified event
Parameters:
Name Type Description
type String
listener function
Inherited From:
Source:
See:
Returns:
EventTarget
this

offAll() → {EventTarget}

Removes all listeners
Inherited From:
Source:
See:
Returns:
EventTarget
this

on(type, listener) → {EventTarget}

Adds a listener to the specified event
Parameters:
Name Type Description
type String
listener function
Inherited From:
Source:
See:
Returns:
EventTarget
this

remove(item) → (nullable) {*}

Removes an item from the loading queue
Parameters:
Name Type Description
item *
Source:
To Do:
  • Remove function from setPathList
Returns:
*

removeAllEventListeners() → {EventTarget}

Removes all listeners
Inherited From:
Source:
Returns:
EventTarget
this

removeEventListener(type, listener) → {EventTarget}

Removes a listener from the specified event
Parameters:
Name Type Description
type String
listener function
Inherited From:
Source:
Returns:
EventTarget
this

reset() → {Loader}

Resets the loader
Source:
Returns:
Loader
this

start() → {Loader}

Starts the loader
Source:
Returns:
Loader
this

toString() → {String}

Returns the EventTarget string value
Inherited From:
Source:
Returns:
String