Namespace: mmir

mmir

Main module / namespace for the MMIR framework. On initialization, a global module 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. "mmirf/core").

Classes

CommonUtils
ConfigurationManager
ControllerManager
DialogManager
DisabledLogging
InputManager
LanguageManager
Logging
MediaManager
ModelManager
NotificationManager
PresentationManager
Resources
SemanticInterpreter

Namespaces

parser

Members

protected,staticmmir._definefunction

Attached define-function for "declaring" modules that is used by the framework. See requirejs documentation on details about the define function.
Default Value:
  • define
See:

protected,staticmmir._mmirLibPathString

The (relative) path pointing to the mmir-lib, in case the library is located somewhere other than mmirf/ (relative to the main HTML page). Normally, it should not be necessary to change this. NOTE: if specified, the path should end with a slash, otherwise loading the library may fail!
Default Value:
  • undefined (will use the default configuration for the path)

staticmmir.confmmir.ConfigurationManager

staticmmir.ctrlmmir.ControllerManager

staticmmir.debugBoolean

Property for enabling / disabling logging: if set to 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.
Default Value:
  • true
See:

staticmmir.dialogmmir.DialogManager

staticmmir.dialogEnginemmir.DialogEngine

staticmmir.inputmmir.InputManager

staticmmir.inputEnginemmir.InputEngine

staticmmir.jqueryjQuery

The jQuery instance that will be used by the MMIR library. Will be automatically set, if jQuery is loaded before the MMIR library initializes (or can be manually set, before the MMIR library initializes). If jQuery is present, the MMIR library will utilize its implementation for some utility functions (otherwise alternative, internal utiltiy implemenations will be used). NOTE: changing this field after the MMIR library has initialized will have no effect.
Default Value:
  • undefined (will be set automatically, if jQuery was loaded)

staticmmir.langmmir.LanguageManager

staticmmir.libModeundefined "min"

Mode for vendor libraries: if "min" the minified/optimized variants (if available) for vendor libraries are used.
Default Value:
  • {Void}

staticmmir.logLevelInteger String LogLevelOptions

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. 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"
or a LogLevelOptions object:
{
	level: LogLevel  // OPTIONAL the default log level as integer or string, DEFAULT: "debug"
	levels: {        // OPTIONAL list of modules for per log level (unspecified modules will have default log level)
		[logLevel]: Array  // list of modules for the LogLevel
	},
	modules: {       // OPTIONAL log level per module (unspecified modules will have default log level)
		[moduleId]: LogLevel      // log level for the module
}
NOTE: LogLevelOptions.levels and LogLevelOptions.modules will be overriden by module configurations, i.e.
core.config({config: {"moduleId": {logLevel: LOGLEVEL}}})
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)
Default Value:
  • "debug"
See:
Example
var logLevelOpt = {
	level: "warn",
	levels: {
		0: ["mmirf/mediaManager"],
		critical: ["mmirf/notificationManager", "mmirf/view"]
	},
	modules: {
		"mmirf/presentationManager": 3,
		"mmirf/commonUtils": "disabled"
	}
}

staticmmir.logTraceBoolean PlainObject

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. If set to a configuration object:
{
		"trace": [true | false],	//same as the Boolean primitive for logTrace, DEFAULT: true
		"depth": ["full" | any]	//OPTIONAL: if "full" then the complete stack trace is printed,
									// otherwise only the first stack-entry (i.e. the calling function)
									// is printed.
									//DEFAULT: any
}
i.e. {trace: true} would be the same as using true (or omitting this property). The default value (also if omitted!) is true.
Default Value:
  • true
See:

staticmmir.mediammir.MediaManager

static,readonlymmir.mmirNameString

The name of the (this) the core module: this is also the global variable by which the core module (this) can be accessed. NOTE: changing this name here will have no affect on the name of the global variable, instead set global variable MMIR_CORE_NAME before loading mmir
Default Value:
  • {String} "mmir"

staticmmir.modelmmir.ModelManager

staticmmir.notifiermmir.NotificationManager

staticmmir.presentmmir.PresentationManager

staticmmir.requirefunction

Attached require-function that is used by the framework to load dependencies.
Default Value:
  • requirejs
See:

staticmmir.resmmir.Resources

staticmmir.semanticmmir.SemanticInterpreter

staticmmir.startModuleString

The name / ID of the RequireJS module that will be loaded, after the configuration in 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:
  • {String} "mmirf/main" will load the module specified in /main.js

staticmmir.startModulesArray.<String>

A list of names / RequireJS module IDs, that will be loaded immediately before loading/initializing the mmir library.
Default Value:
  • {Void}

staticmmir.utilmmir.CommonUtils

static,readonlymmir.versionString

The version of mmir-lib.

staticmmir.viewEngineString

Name / ID / load-path (requirejs) for the module that handles the views (i.e. "rendering" that is change from one view to the next).
Default Value:
  • "mmirf/simpleViewEngine" will load the default view-engine that uses standard HTML document API

Methods

protected,staticmmir.applyConfigs()

Applies settings that were added via config.

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.

staticmmir.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.

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.

Name Type Description
options PlainObject options for RequireJS
Example
//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: { 'mmirf/dialogManager': {logLevel: 'warn'}, 'mmirf/inputManager': {logLevel: 'warn'}}});

//... or using alternative SCXML definition for dialog-engine:
mmir.config({config: { 'mmirf/dialogManager': {modelUri: 'config/states/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'}};

staticmmir.isVersion(version, comp){Boolean|Void}

Check if the version number corresponds to the most significant (right-most) part of the mmir-lib's version number, i.e. check "is version comp than the mmir-lib version?"
NOTE: changing the mmir.version field will have no effect on this function (i.e. it will use the original value of version)
Name Type Description
version Number the version number to check against
comp String optional OPTIONAL the comparison type, e.g. ">" | "<" | ">=" | "<=" | "==" | "===" | "!=" | "!=="
Will be used as follows: {mmir-lib version} {comp} {version}
DEFAULT: "==="
NOTE: "=" will be interpreted as "=="
Returns:
Type Description
Boolean | Void returns the result of the comparison to most the significant part of the mmir-lib version number, or VOID if the mmir-lib version number is not available.

staticmmir.ready(func)

Register callbacks for initialization-event of framework. If used after framework has been initialized, the callback is invoked immediately.
Name Type Description
func function callback Function that will be triggered when the framework has been initialized