Class: PredefinedResReferer

Kekule. PredefinedResReferer

new PredefinedResReferer()

Utility class to handle values refered to a predefined resource.
Source:

Methods

(static) extractReferedValue(str) → {String}

Extract value inside resource referer's parenthesis (e.g. #id from url(#id), url from url('url')).
Parameters:
Name Type Description
str String
Source:
Returns:
Type
String

(static) isResReferrer(str) → {Bool}

Check if a str is a resource referrer (like url(#id) or url('url')).
Parameters:
Name Type Description
str String
Source:
Returns:
Type
Bool

(static) isResValue(str) → {Bool}

Check if a str is a resource referer (like url(#id) or url('url')) or JSON text. Both types may be used as resource.
Parameters:
Name Type Description
str String
Source:
Returns:
Type
Bool

(static) loadResource(refStr, callback, resType)

Get resource content from resource reference string. When the retrieve is done, callback will be called.
Parameters:
Name Type Description
refStr String
callback function Called after resource is loaded. The callback function has the following params: callback(resInfo, success) resInfo will be null if loading failed. On success,resInfo is a hash object, contains the following fields: {data, text, resType, resUrl}.
resType String
Source: