StructureJS

0.15.2

A class based utility library for building modular and scalable web platform applications. Features opt-in classes and utilities which provide a solid foundation and toolset to build your next project.

ApplicationCacheService Class

The ApplicationCacheService is a static class works with the window applicationCache object.

Index

Show:

Properties

Methods

Properties

_appCache ApplicationCache private static

A reference to the applicationCache property on the window object.

_eventDispatcher EventDispatcher private static

A reference to the EventDispatcher object.

isEnabled Boolean public static

The isEnabled property is used to keep track of the enabled state.

Default: false

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

Methods

_onCached
(
  • event
)
private static

The resources listed in the manifest have been fully downloaded, and the application is now cached locally.

Parameters:

  • event DOMApplicationCacheEvent

    The native browser event from the DOMApplicationCache.

_onChecking
(
  • event
)
private static

The browser is checking for an update, or is attempting to download the cache manifest for the first time. This is always the first event in the sequence.

Parameters:

  • event DOMApplicationCacheEvent

    The native browser event from the DOMApplicationCache.

_onDownloading
(
  • event
)
private static

The browser has started to download the cache manifest, either for the first time or because changes have been detected.

Parameters:

  • event DOMApplicationCacheEvent

    The native browser event from the DOMApplicationCache.

_onError
(
  • event
)
private static

An error occurred at some point - this could be caused by a number of things. This will always be the last event in the sequence.

Parameters:

  • event DOMApplicationCacheEvent

    The native browser event from the DOMApplicationCache.

_onNoUpdate
(
  • event
)
private static

The cache manifest hadn't changed.

Parameters:

  • event DOMApplicationCacheEvent

    The native browser event from the DOMApplicationCache.

_onObsolete
(
  • event
)
private static

The cache manifest file could not be found, indicating that the cache is no longer needed. The application cache is being deleted.

Parameters:

  • event DOMApplicationCacheEvent

    The native browser event from the DOMApplicationCache.

_onProgress
(
  • event
)
private static

The browser had downloaded and cached an asset. This is fired once for every file that is downloaded (including the current page which is cached implicitly).

Parameters:

  • event DOMApplicationCacheEvent

    The native browser event from the DOMApplicationCache.

_onUpdateReady
(
  • event
)
private static

The resources listed in the manifest have been newly re-downloaded, and the script can use swapCache() to switch to the new cache.

Parameters:

  • event DOMApplicationCacheEvent

    The native browser event from the DOMApplicationCache.

addEventListener
(
  • type
  • callback
  • scope
  • [priority=0]
)
static

Registers an event listener object with an ApplicationCacheService object so that the listener receives notification of an event.

Parameters:

  • type String

    The type of event.

  • callback Function

    The listener function that processes the event. This function must accept an Event object as its only parameter and must return nothing, as this example shows. @example function(event:Event):void

  • scope Any

    Binds the scope to a particular object (scope is basically what "this" refers to in your function). This can be very useful in JavaScript because scope isn't generally maintained.

  • [priority=0] Int optional

    Influences the order in which the listeners are called. Listeners with lower priorities are called after ones with higher priorities.

Example:

 ApplicationCacheService.addEventListener(ApplicationCacheEvent.UPDATE_READY, this._handlerMethod, this);
 _handlerMethod(event) {
     console.log(event.target + " sent the event.");
 }

dispatchEvent
(
  • event
)
static

Dispatches an event within the ApplicationCacheService object.

Parameters:

Example:

 let event = new ApplicationCacheEvent(ApplicationCacheEvent.UPDATE_READY);
 ApplicationCacheService.dispatchEvent(event);

 // Here is a common inline event being dispatched
 ApplicationCacheService.dispatchEvent(new ApplicationCacheEvent(ApplicationCacheEvent.UPDATE_READY));

removeEventListener
(
  • type
  • callback
  • scope
)
static

Removes a specified listener from the ApplicationCacheService object.

Parameters:

  • type String

    The type of event.

  • callback Function

    The listener object to remove.

  • scope Any

    The scope of the listener object to be removed. This was added because it was need for the ApplicationCacheService class. To keep things consistent this parameter is required.

Example:

 ApplicationCacheService.removeEventListener(ApplicationCacheEvent.UPDATE_READY, this._handlerMethod, this);
 _handlerMethod(event) {
     console.log(event.target + " sent the event.");
 }

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index