Skip to content
This repository has been archived by the owner on Oct 25, 2018. It is now read-only.

Configuration

Andrew Larkin edited this page Feb 20, 2014 · 4 revisions

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.

Creating a Configuration File

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.

Configuration Options

  • 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.
Clone this wiki locally