-
Notifications
You must be signed in to change notification settings - Fork 20
Configuration
Developers can tell Xooie where to find modules by defining the path to a module in a configuration file. Modules are categorized as either a Widget or an Addon.
Configuration files are useful if you are using the uncompressed version of Xooie and you need to specify the location of the Xooie modules.
Xooie configuration files are simple JavaScript files. There are two ways to set configuration data. If you wish to set default functionality before Xooie has been loaded you can define a default Xooie object:
Xooie = {
widgets: {
someModuleName: "pathToModule"
},
addons: {
someAddonName: "pathToAddon"
}
};
Bear in mind that using this method must be done before loading the Xooie library. Loading this script after Xooie has been loaded overwrite the global Xooie object.
Another method looks like this:
Xooie.config({
widgets: {
someModuleName: "pathToModule"
},
addons: {
someAddonName: "pathToAddon"
}
});
The Xooie.config
method will allow developers to define paths after Xooie has loaded. When the document is fully loaded Xooie will locate the modules at the paths specified.
- widgets: Key-value pairs of a module name and the location of the module.
- addons:_ Key-value pairs of a addon name and the location of the addon.