|
|
|
_callLoaded(
) :
void
|
|
|
|
_getModulePrefix(
module
: String
) :
void
gets the prefix associated with module
Parameter |
Type |
Usage |
Description |
module |
String |
required |
|
|
|
|
|
_getModuleSymbols(
modulename
: String
) :
void
Converts a module name in dotted JS notation to an array
representing the path in the source tree
Parameter |
Type |
Usage |
Description |
modulename |
String |
required |
|
|
|
|
|
_getText(
uri
: URI
fail_ok
: Boolean
) :
void
Read the contents of the specified uri and return those contents.
Parameter |
Type |
Usage |
Description |
uri |
URI |
required |
A relative or absolute uri. |
fail_ok |
Boolean |
required |
Default false. If fail_ok and loading fails, return null
instead of throwing. |
|
|
|
|
_inContext(
g
d
f
) :
void
Parameter |
Type |
Usage |
Description |
g |
|
required |
|
d |
|
required |
|
f |
|
required |
|
|
|
|
|
_isDocumentOk(
http
) :
void
Parameter |
Type |
Usage |
Description |
http |
|
required |
|
|
|
|
|
_isLocalUrl(
uri
: String
) :
void
determines if URI is local or not.
Parameter |
Type |
Usage |
Description |
uri |
String |
required |
|
|
|
|
|
_loadInit(
e
) :
void
Parameter |
Type |
Usage |
Description |
e |
|
required |
|
|
|
|
|
_loadModule(
) :
void
|
|
|
|
_loadPath(
relpath
: String
module
: String
cb
: Function
) :
void
Internal xd loader function. Overrides loadPath() from loader.js.
xd loading requires slightly different behavior from loadPath().
Loads and interprets the script located at relpath, which is
relative to the script root directory. If the script is found but
its interpretation causes a runtime exception, that exception is
not caught by us, so the caller will see it. We return a true
value if and only if the script is found.
Parameter |
Type |
Usage |
Description |
relpath |
String |
required |
A relative path to a script (no leading '/', and typically ending
in '.js'). |
module |
String |
optional |
A module whose existance to check for after loading a path. Can be
used to determine success or failure of the load. |
cb |
Function |
optional |
a callback function to pass the result of evaluating the script |
|
|
|
|
_loadUri(
uri
: String
cb
: Function
currentIsXDomain
: boolean
module
: String
) :
void
Internal xd loader function. Overrides loadUri() from loader.js.
xd loading requires slightly different behavior from loadPath().
Wanted to override getText(), but it is used by
the widget code in too many, synchronous ways right now.
Parameter |
Type |
Usage |
Description |
uri |
String |
required |
a uri which points at the script to be loaded |
cb |
Function |
required |
a callback function to process the result of evaluating the script
as an expression, typically used by the resource bundle loader to
load JSON-style resources |
currentIsXDomain |
boolean |
required |
|
module |
String |
required |
|
|
|
|
|
_loadUriAndCheck(
uri
: String
moduleName
: String
cb
: Function
) :
void
calls loadUri then findModule and returns true if both succeed
Parameter |
Type |
Usage |
Description |
uri |
String |
required |
|
moduleName |
String |
required |
|
cb |
Function |
optional |
|
|
|
|
|
_moduleHasPrefix(
module
: String
) :
void
checks to see if module has been established
Parameter |
Type |
Usage |
Description |
module |
String |
required |
|
|
|
|
|
_modulesLoaded(
) :
void
|
|
|
|
_onto(
arr
obj
fn
) :
void
Parameter |
Type |
Usage |
Description |
arr |
|
required |
|
obj |
|
required |
|
fn |
|
required |
|
|
|
|
|
_spidermonkeyCurrentFile(
depth
) :
void
Parameter |
Type |
Usage |
Description |
depth |
|
required |
|
|
|
|
|
_Url(
) :
void
Constructor to create an object representing a URL.
It is marked as private, since we might consider removing
or simplifying it.
Each argument is evaluated in order relative to the next until
a canonical uri is produced. To get an absolute Uri relative to
|
|
|
|
_xdClearInterval(
) :
void
Internal xd loader function.
Clears the interval timer used to check on the
status of in-flight xd module resource requests.
|
|
|
|
_xdCreateResource(
contents
: String
resourceName
: String
resourcePath
: String
) :
void
Internal xd loader function. Creates an xd module source given an
non-xd module contents.
Parameter |
Type |
Usage |
Description |
contents |
String |
required |
|
resourceName |
String |
required |
|
resourcePath |
String |
required |
|
|
|
|
|
_xdDebugFileLoaded(
resourceName
) :
void
Parameter |
Type |
Usage |
Description |
resourceName |
|
required |
|
|
|
|
|
_xdEvalReqs(
reqChain
: Array
) :
void
Internal xd loader function.
Does a depth first, breadth second search and eval of required modules.
Parameter |
Type |
Usage |
Description |
reqChain |
Array |
required |
|
|
|
|
|
_xdExtractLoadInits(
fileContents
: String
) :
void
|
|
|
|
_xdInitExtraLocales(
) :
void
|
|
|
|
_xdIsXDomainPath(
relpath
: string
) :
void
Figure out whether the path is local or x-domain
If there is a colon before the first / then, we have a URL with a protocol.
Parameter |
Type |
Usage |
Description |
relpath |
string |
required |
|
|
|
|
|
_xdLoadFlattenedBundle(
moduleName
: String
bundleName
: String
locale
: String
bundleData
: Object
) :
void
Internal xd loader function. Used when loading
a flattened localized bundle via a script tag.
Parameter |
Type |
Usage |
Description |
moduleName |
String |
required |
|
bundleName |
String |
required |
|
locale |
String |
optional |
|
bundleData |
Object |
required |
|
|
|
|
|
_xdNotifyLoaded(
) :
void
|
|
|
|
_xdReset(
) :
void
Internal xd loader function. Resets the xd state.
|
|
|
|
_xdResourceLoaded(
res
: Object
) :
void
Internal xd loader function. Called by an xd module resource when
it has been loaded via a script tag.
Parameter |
Type |
Usage |
Description |
res |
Object |
required |
|
|
|
|
|
_xdUnpackDependency(
dep
: Array
) :
void
Internal xd loader function. Determines what to do with a dependency
that was listed in an xd version of a module contents.
Parameter |
Type |
Usage |
Description |
dep |
Array |
required |
|
|
|
|
|
_xdWalkReqs(
) :
void
Internal xd loader function.
Walks the requires and evaluates module resource contents in
the right order.
|
|
|
|
_xdWatchInFlight(
) :
void
Internal xd loader function.
Monitors in-flight requests for xd module resources.
|
|
|
|
_xhrObj(
) :
void
|
|
|
|
addOnLoad(
obj
: Object
functionName
: String|Function
) :
void
Registers a function to be triggered after the DOM and dojo.require() calls
have finished loading.
Registers a function to be triggered after the DOM has finished
loading and `dojo.require` modules have loaded. Widgets declared in markup
have been instantiated if `djConfig.parseOnLoad` is true when this fires.
Images and CSS files may or may not have finished downloading when
the specified function is called. (Note that widgets' CSS and HTML
code is guaranteed to be downloaded before said widgets are
instantiated, though including css resouces BEFORE any script elements
is highly recommended).
Parameter |
Type |
Usage |
Description |
obj |
Object |
required |
|
functionName |
String|Function |
optional |
|
Examples
|
|
|
|
addOnWindowUnload(
obj
: Object
functionName
: String|Function
) :
void
registers a function to be triggered when window.onunload fires.
Be careful trying to modify the DOM or access JavaScript properties
Parameter |
Type |
Usage |
Description |
obj |
Object |
optional |
|
functionName |
String|Function |
optional |
|
Examples
|
|
|
|
body(
) :
void
|
|
|
|
byId(
id
doc
) :
void
Parameter |
Type |
Usage |
Description |
id |
|
required |
|
doc |
|
required |
|
|
|
|
|
exit(
exitcode
) :
void
Parameter |
Type |
Usage |
Description |
exitcode |
|
required |
|
|
|
|
|
loaded(
) :
void
signal fired when initial environment and package loading is
complete. You should use dojo.addOnLoad() instead of doing a
direct dojo.connect() to this method in order to handle
initialization tasks that require the environment to be
initialized. In a browser host, declarative widgets will
be constructed when this function finishes runing.
|
|
|
|
loadInit(
init
: Function
) :
void
Executes a function that needs to be executed for the loader's dojo.requireIf
resolutions to work. This is needed mostly for the xdomain loader case where
a function needs to be executed to set up the possible values for a dojo.requireIf
call.
This function is mainly a marker for the xdomain loader to know parts of
code that needs be executed outside the function wrappper that is placed around modules.
The init function could be executed more than once, and it should make no assumptions
on what is loaded, or what modules are available. Only the functionality in Dojo Base
is allowed to be used. Avoid using this method. For a valid use case,
see the source for dojox.gfx.
Parameter |
Type |
Usage |
Description |
init |
Function |
required |
a function reference. Executed immediately. |
|
|
|
|
moduleUrl(
module
: String
url
: dojo._Url||String
) :
void
Returns a dojo._Url object relative to a module.
Parameter |
Type |
Usage |
Description |
module |
String |
required |
|
url |
dojo._Url||String |
required |
|
Examples
|
|
|
|
platformRequire(
modMap
: Object
) :
void
|
|
|
|
popContext(
) :
void
If the context stack contains elements, ensure that
subsequent code executes in the *previous* context to the
current context. The current context set ([global,
document]) is returned.
|
|
|
|
provide(
resourceName
: String
) :
void
Register a resource with the package system. Works in conjunction with dojo.require
Each javascript source file is called a resource. When a
resource is loaded by the browser, `dojo.provide()` registers
that it has been loaded.
Each javascript source file must have at least one
`dojo.provide()` call at the top of the file, corresponding to
the file name. For example, `js/dojo/foo.js` must have
`dojo.provide("dojo.foo");` before any calls to
`dojo.require()` are made.
For backwards compatibility reasons, in addition to registering
the resource, `dojo.provide()` also ensures that the javascript
object for the module exists. For example,
`dojo.provide("dojox.data.FlickrStore")`, in addition to
registering that `FlickrStore.js` is a resource for the
`dojox.data` module, will ensure that the `dojox.data`
javascript object exists, so that calls like
`dojo.data.foo = function(){ ... }` don't fail.
In the case of a build where multiple javascript source files
are combined into one bigger file (similar to a .lib or .jar
file), that file may contain multiple dojo.provide() calls, to
note that it includes multiple resources.
Parameter |
Type |
Usage |
Description |
resourceName |
String |
required |
A dot-sperated string identifying a resource. |
Examples
|
|
|
|
pushContext(
g
: Object|String
d
: MDocumentElement
) :
void
causes subsequent calls to Dojo methods to assume the
passed object and, optionally, document as the default
scopes to use. A 2-element array of the previous global and
document are returned.
dojo.pushContext treats contexts as a stack. The
auto-detected contexts which are initially provided using
dojo.setContext() require authors to keep state in order to
"return" to a previous context, whereas the
dojo.pushContext and dojo.popContext methods provide a more
natural way to augment blocks of code to ensure that they
execute in a different window or frame without issue. If
called without any arguments, the default context (the
context when Dojo is first loaded) is instead pushed into
the stack. If only a single string is passed, a node in the
intitial context's document is looked up and its
contextWindow and contextDocument properties are used as
the context to push. This means that iframes can be given
an ID and code can be executed in the scope of the iframe's
document in subsequent calls easily.
Parameter |
Type |
Usage |
Description |
g |
Object|String |
optional |
The global context. If a string, the id of the frame to
search for a context and document. |
d |
MDocumentElement |
optional |
The document element to execute subsequent code with. |
|
|
|
|
ready(
) :
void
|
|
|
|
registerModulePath(
module
: String
prefix
: String
) :
void
Maps a module name to a path
An unregistered module is given the default path of ../[module],
relative to Dojo root. For example, module acme is mapped to
../acme. If you want to use a different module name, use
dojo.registerModulePath.
Parameter |
Type |
Usage |
Description |
module |
String |
required |
|
prefix |
String |
required |
|
Examples
|
|
|
|
require(
moduleName
: String
omitModuleCheck
: Boolean
) :
void
loads a Javascript module from the appropriate URI
Parameter |
Type |
Usage |
Description |
moduleName |
String |
required |
module name to load, using periods for separators,
e.g. "dojo.date.locale". Module paths are de-referenced by dojo's
internal mapping of locations to names and are disambiguated by
longest prefix. See dojo.registerModulePath() for details on
registering new modules. |
omitModuleCheck |
Boolean |
optional |
if true , omitModuleCheck skips the step of ensuring that the
loaded file actually defines the symbol it is referenced by.
For example if it called as dojo.require("a.b.c") and the
file located at a/b/c.js does not define an object a.b.c ,
and exception will be throws whereas no exception is raised
when called as dojo.require("a.b.c", true) |
Examples
|
|
|
|
requireIf(
condition
: Boolean
resourceName
: String
) :
void
If the condition is true then call dojo.require() for the specified
resource
Parameter |
Type |
Usage |
Description |
condition |
Boolean |
required |
|
resourceName |
String |
required |
|
Examples
|
|
|
|
requireLocalization(
moduleName
: String
bundleName
: String
locale
: String
availableFlatLocales
: String
) :
void
loads a bundle intelligently based on whether the module is
local or xd. Overrides the local-case implementation.
Load translated resource bundles provided underneath the "nls"
directory within a package. Translated resources may be located in
different packages throughout the source tree.
Each directory is named for a locale as specified by RFC 3066,
Parameter |
Type |
Usage |
Description |
moduleName |
String |
required |
name of the package containing the "nls" directory in which the
bundle is found |
bundleName |
String |
required |
bundle name, i.e. the filename without the '.js' suffix. Using "nls" as a
a bundle name is not supported, since "nls" is the name of the folder
that holds bundles. Using "nls" as the bundle name will cause problems
with the custom build. |
locale |
String |
optional |
the locale to load (optional) By default, the browser's user
locale as defined by dojo.locale |
availableFlatLocales |
String |
optional |
A comma-separated list of the available, flattened locales for this
bundle. This argument should only be set by the build process. |
Examples
|
|
|
|
unloaded(
) :
void
signal fired by impending environment destruction. You should use
dojo.addOnUnload() instead of doing a direct dojo.connect() to this
method to perform page/application cleanup methods. See
dojo.addOnUnload for more info.
|
|
|
|
windowUnloaded(
) :
void
signal fired by impending window destruction. You may use
dojo.addOnWIndowUnload() or dojo.connect() to this method to perform
page/application cleanup methods. See dojo.addOnWindowUnload for more info.
|
|
|
|
xdRequireLocalization(
m
b
locale
: String
fLocales
moduleName
: String
bundleName
: String
availableFlatLocales
: String
) :
void
Internal xd loader function. The xd version of dojo.requireLocalization.
Parameter |
Type |
Usage |
Description |
m |
|
required |
|
b |
|
required |
|
locale |
String |
optional |
|
fLocales |
|
required |
|
moduleName |
String |
required |
|
bundleName |
String |
required |
|
availableFlatLocales |
String |
required |
|
|