API Docs for: v2.1.0
Show:

CGSGCSSManager Class

Extends CGSGObject
Module: Util

A CGSGCSSManager represent a basic circle

Constructor

CGSGCSSManager

()

Methods

_createDelegate

(
  • objectContext
  • delegateMethod
)
Function private

used to call delegate method when the css file is finally loaded

Parameters:

Returns:

_onFileAbort

(
  • event
)
protected

To be overrided when the css file loading is aborted

Parameters:

  • event Event

_onFileError

(
  • event
)
protected

To be overrided when the css file failed to load

Parameters:

  • event Event

_onFileLoaded

(
  • event
)
private

fired when the css file is loaded.

Parameters:

  • event Event

getAttr

(
  • cls
  • attr
)
String

Return the value for the attribute of the class passed as parameters

Parameters:

  • cls String

    Name of the CSS class

  • attr String

    Name of the attribute

Returns:

getAttrInArray

(
  • clss
  • attr
)
String

Return the value for the latest attribute of the classes passed as parameters

Parameters:

  • clss Array

    list of CSS classes

  • attr String

    name of the CSS attribute

Returns:

String:

value for the CSS attribute

getCls

(
  • cls
)
Array

Parameters:

  • cls String

    Name of the CSS class

Returns:

Array:

Array of attributes

getFloat

(
  • attr
)
Float

Extract the number from an attribute's value. For example getFloat("0.6px"); will return 0.6.

Parameters:

Returns:

Float:

getNumber

(
  • attr
)
Number

Extract the number from an attribute's value. For example getNumber("8px"); will return 8.

Parameters:

Returns:

getNumber

(
  • attr
)
Number

Extract the number from an attribute's value. For example getNumber("8px"); will return 8.

Parameters:

Returns:

ignoreCSSFile

(
  • href
)

Blacklist this file. Cache need to be invalidated after by calling {invalidateCache} method

Parameters:

  • href String

    Must be full href path and filename

invalidateCache

()

Read content of all CSS files loaded and update its cache

loadCSSFile

(
  • url
)

Store CSS attributes form the file in memory

Parameters:

unloadCSSFile

(
  • filename
)

Unload CSS file from current HTML page. Cache need to be invalidated after by calling {invalidateCache} method

Parameters:

Properties

_blacklist

Array private

List of CSS files to be ignored

_classes

Array private

All css classes loaded for the current HTML document. [selectorText {String}, style {CSSStyleDeclaration}]

_isLoaded

Boolean private

onLoadAbort

Function node:this

Event Fired when the css file loading is aborted

Default: null

onLoadEnd

Function node:this

Event Fired when the css file is finally loaded

Default: null

onLoadError

Function node:this

Event Fired when the css file failed to load

Default: null