Namespace mmir
Defined in: core.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Main module / namespace for the MMIR framework.
|
Field Attributes | Field Name and Description |
---|---|
<static> |
mmir.debug
Property for enabling / disabling logging:
if set to
true (or omitted), the default Logger implementation tools/logger.js
will be loaded as "logger" module. |
<static> |
mmir.logLevel
Property for the log-level of the Logger module:
if set, and property
debug is true , then the logger module
will use the log-level as default log-level. |
<static> |
mmir.logTrace
Property for enabling / disabling trace output in the Logger module:
if set to
true , and property debug is true , then
the logger module will print a stack-trace for each log-message. |
<static> |
mmir.mmirName
The name of the (this) the core module:
this is also the global variable by which the core module (this) can be accessed.
|
<static> |
mmir.startModule
The name / ID of the RequireJS module that will
be loaded, after the configuration in
mainConfig.js was applied. |
<static> |
mmir.viewEngine
Name / ID / load-path (requirejs) for the module
that handles the views (i.e.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
mmir.applyConfigs()
Applies settings that were added via
#config.
|
<static> |
mmir.config(options)
Set options / settings for overwriting the default
configuration for RequireJS:
Options / configurations that are added by this method will overwrite settings specified in mainConfig.js . |
<static> |
mmir.ready(func)
Register callbacks for initialization-event of framework.
|
window.mmir
is created.
If called multiple times, the existing module instance is returned.
If a function require
exists, the module tries to registers itself
according to the RequireJS interface (using the default as its module name, i.e. "core").
- Returns:
- the module instance
mmir
true
(or omitted), the default Logger implementation tools/logger.js
will be loaded as "logger" module.
If set to false
the "dummy" Logger implementation tools/loggerDisabled.js
will
be loaded as "logger" module which essentially will create no logging output.
- See:
- mmir.logLevel
- Default Value:
- true
debug
is true
, then the logger module
will use the log-level as default log-level.
If omitted, the Logger's implementation defaults will be used.
If set, the property must be either a Number or a String with one of the following values:
0: "verbose"
1: "debug"
2: "info"
3: "warn"
4: "error"
5: "critical"
6: "disabled"
NOTE: if you want to disable logging completely, use mmir.debug.
Setting the logLevel to "disabled" will still allow specific module's to create logging output
(if their log-level is set appropriately)
- See:
- mmir.debug
- Default Value:
- "debug"
true
, and property debug
is true
, then
the logger module will print a stack-trace for each log-message.
If set to a configuration object:
{ "trace": [true | false], //same as the Boolean primitive for logTrace "depth": ["full" | other] //OPTIONAL: if "full" then the complete stack trace is printed, // otherwise only the first stack-entry (i.e. the calling function) // is printed. //DEFAULT: other }i.e.
{trace: true}
would be the same as using true
(or omitting this property).
The default value (also if omitted!) is true
.
- See:
- mmir.debug
- mmir.logLevel
- Default Value:
- true
- Default Value:
- "mmir"
mainConfig.js
was applied.
This module should first start-up the framework and then signal the application (via mmir.setInitialized) that it is ready to be used, i.e. fully initialized now.
NOTE: If set to undefined
, no module will be
loaded after configuration in mainConfig.js
was applied.
- Default Value:
- "main" will load the module specified in /main.js
- Default Value:
- "jqmViewEngine" will load the default view-engine that uses jQuery Mobile
WARNING: use this only, if you know what
you are doing -- normally this
functions is only called once
during initialization by the
framework, after the default
configuration settings for
RequireJS in mainConfig.js
were applied.
NOTE: this is a semi-private function that should only be used by the initialization process.
Options / configurations that are added by this method will overwrite settings specified in
mainConfig.js
.
NOTE: the options added here will be applied in the order they were added, i.e. if a later option specifies settings that were already set by a previous call, then these later options will overwrite the earlier ones.
//IMPORTANT these calls need to done, AFTER core.js is loaded, but BEFORE require.js+mainConfig.js is loaded //(see example index.html in starter-kit) //set specific log-level for module "moduleName": mmir.config({config: { 'moduleName': {logLevel: 'warn'}}}); //modify default log-levels for dialogManager and inputManager: mmir.config({config: { 'dialogManager': {logLevel: 'warn'}, 'inputManager': {logLevel: 'warn'}}}); //... or using alternative SCXML definition for dialog-engine: mmir.config({config: { 'dialogManager': {scxmlDoc: 'config/statedef/example-view_transitions-dialogDescriptionSCXML.xml'}); //overwrite module location (BEWARE: you should know what you are doing, if you use this) mmir.config({paths: {'jquery': 'content/libs/zepto'}}; //add ID and location for own module (NOTE: need to omit file-extension ".js" in location! see requirejs docs): mmir.config({paths: {'customAppRouter': 'content/libs/router'}};
- Parameters:
- {PlainObject} options
- options for RequireJS
- Parameters:
- {Function} func
- callback Function that will be triggered when the framework has been initialized