The following are the various functions provided by Ajile:
Back to Documentation
Ajile.AddImportListener:
The Ajile.AddImportListener([moduleName,] listener) function is provided to
allow developers to add event listeners for import events.
Syntax:
Ajile.AddImportListener([moduleName,] listener);
Parameters:
moduleName - An optional parameter that is expected to be a String. When
this parameter is specified, it must be the fully-qualified
name of a module that was or will be imported.
When this parameter is omitted, Ajile adds the supplied listener
function as a generic listener for all import events.
NOTE: When Ajile notifies import event listeners, it first
notifies specific listeners (listeners for specifically named
modules) then the generic (non-module-specific) import event
listeners.
listener - A required parameter that must be a reference to a function.
The function should be defined to accept at least one
parameter, a String representing the imported module's
fully-qualified name.
When this listener function is called by Ajile, the imported
module's fully-qualifed name is sent as a parameter.
Generic import listeners can use the parameter to determine if
all of the required module have been successfully imported
before attempting to use them.
Examples:
Ajile.AddImportListener(moduleName, listener); // Notifies listener of import event for specified module.
Ajile.AddImportListener(listener); // Notifies listener of all import events.
See:
- Ajile.RemoveImportListener()
Back to Top or Documentation
Ajile.EnableCloak:
The Ajile.EnableCloak([cloakState]) function is provided to allow developers
to conceal their code at runtime.
Cloaking is enabled by default.
Syntax:
Ajile.EnableCloak([cloakState]);
Parameters:
cloakState - An optional parameter that when omitted or set to true,
instructs Ajile to conceal the source code for modules imported
or loaded after the option is set. Otherwise when set to false
instructs Ajile to allow subsequently imported/loaded modules
source code to be seen.
Examples:
Ajile.EnableCloak(); // Enables cloaking.
Ajile.EnableCloak(true); // Enables cloaking.
Ajile.EnableCloak(false); // Disables cloaking.
See:
- cloak option
Back to Top or Documentation
Ajile.EnableDebug:
The Ajile.EnableDebug([debugState]) function is provided to allow
developers to observe Ajile's debug information. The optional debugState
parameter indicates whether to generate or supress debug information.
The Debug log contains detailed information about the execution process for
operations performed using any of Ajile's Directives or Functions.
Debugging is disabled by default.
Syntax:
Ajile.EnableDebug([debugState]);
Parameters:
debugState - An optional parameter that when omitted or set to true,
instructs Ajile to generate debug information. Otherwise when
set to false instructs Ajile to suppress debug information.
Examples:
Ajile.EnableDebug(); // Enables debug information.
Ajile.EnableDebug(true); // Enables debug information.
Ajile.EnableDebug(false); // Disables debug information.
See:
- debug option
- Ajile.ShowLog()
Back to Top or Documentation
Ajile.EnableLegacy():
The Ajile.EnableLegacy([legacyState]) function is provided to enable/disable
support for legacy (deprecated) Directives, Functions, and data types.
Legacy support is disabled by default.
Syntax:
Ajile.EnableLegacy([legacyState]);
Parameters:
legacyState - An optional parameter that when omitted or set to true,
instructs Ajile to support deprecated features such as the
JSImport, JSLoad, JSPackage, Import, Load, and Package
directives and other deprecated functions and data types. When
legacyState is set to false Ajile is instructed to disallow
legacy support and will not process legacy directives,
functions, or datatypes.
Examples:
Ajile.EnableLegacy(); // Enables legacy support.
Ajile.EnableLegacy(true); // Enables legacy support.
Ajile.EnableLegacy(false); // Disables legacy support.
See:
- legacy option
Back to Top or Documentation
Ajile.EnableOverride:
The Ajile.EnableOverride([overrideState]) function is provided to allow
similarly named types to override/cancel-out each other.
Overriding is disabled by default.
Syntax:
Ajile.EnableOverride([overrideState]);
Parameters:
overrideState - An optional parameter that when omitted or set to true,
instructs Ajile to suppress naming conflicts and allow
similarly named types to override each other. Otherwise when
set to false instructs Ajile to disallow type overrings and
generate logged warnings about the naming conflict.
Examples:
Ajile.EnableOverride(); // Enables overriding.
Ajile.EnableOverride(true); // Enables overriding.
Ajile.EnableOverride(false); // Disables overriding.
See:
- override option
Back to Top or Documentation
Ajile.EnableRefresh:
The Ajile.EnableRefresh([refreshState]) function is provided to support
managing the refreshing/caching of loaded scripts and imported modules.
Refreshing is disabled by default.
Syntax:
Ajile.EnableRefresh([refreshState]);
Parameters:
refreshState - An optional parameter that when omitted or set to true,
instructs Ajile to generate fresh requests for each
subsequently loaded script and imported module. When set to
false, Ajile will rely on the browser's caching mechanism to
determine when to make fresh requests.
This option can be used to either work with or circumvent
the browser's caching mechanism.
Examples:
Ajile.EnableRefresh(); // Enables refreshing.
Ajile.EnableRefresh(true); // Enables refreshing.
Ajile.EnableRefresh(false); // Disables refreshing.
See:
- refresh option
Back to Top or Documentation
Ajile.GetVersion:
The Ajile.GetVersion() function is provided to allow developers to retrieve
Ajile's version information. The function returns a string representing the
available version information.
Syntax:
Ajile.GetVersion();
Returns:
A string representing Ajile's version information.
Examples:
var ajileVersion = Ajile.GetVersion();
alert("Ajile's version is: "+ ajileVersion);
Back to Top or Documentation
Ajile.RemoveImportListener:
The Ajile.RemoveImportListener([moduleName,] listener) function is provided
to allow developers to remove a previously added import event listener.
Syntax:
Ajile.RemoveImportListener([moduleName,] listener);
Parameters:
moduleName - An optional parameter that when specified is expected to be a
String value representing the fully-qualified name of a module.
This parameter allows multiple listeners to receive import
notification for a single module.
This parameter can be omitted if it was also omitted when the
Ajile.AddImportListener() function was used.
listener - A required parameter that must be the same function reference
that was supplied to the Ajile.AddImportListener() function.
Examples:
Ajile.RemoveImportListener(moduleName, listener); // Removes the listener from list of moduleName import observers.
Ajile.RemoveImportListener(listener); // Removes the listener from list of generic import observers.
See:
- Ajile.AddImportListener()
Back to Top or Documentation
Ajile.ShowLog:
The Ajile.ShowLog() function provides access to Ajile's debug log. When
debugging is enabled, operation details are continuosly written to the log.
Use Ajile.ShowLog() at any time to display a snapshot of the log's output.
Syntax:
Ajile.ShowLog();
Examples:
Ajile.ShowLog(); // Opens a new window/tab displaying Ajile's debug log.
See:
- Ajile.EnableDebug()
Back to Top or Documentation
Ajile.Unload:
The Ajile.Unload() function is provided to support memory management,
allowing containers to unload specific modules, namespaces or Ajile and its
resources from memory.
Calling this function with no parameters will remove Ajile's Directives,
Functions, and Properties & Dataypes from memory, making all unavailable
to the current container.
Syntax:
Ajile.Unload([moduleName|namespace]);
Parameters:
moduleName - An optional parameter that can be used to specify the name of
a specific module to remove from memory. When omitted Ajile
will remove itself (com.iskitz.ajile and Ajile) from memory.
namespace - An optional parameter that can be used to specify a namespace
to remove from memory. When omitted Ajile will remove itself
(com.iskitz.ajile and Ajile) from memory.
Examples:
Ajile.Unload(); // Unloads Ajile from memory.
Ajile.Unload("com.iskitz.ajile.Examples"); // Unloads Examples module from memory.
Ajile.Unload("com.iskitz.ajile.examples.*"); // Unloads examples namespace and members from memory.
Back to Top or Documentation