User talk:Gerbrant/fw.js


 * Gerbrant.fw
 * Since this is the actual module loader, it cannot be loaded using the id above.
 * Usage:

document.write('<\u002fscript>');
 * A template is available; it displays:


 * The first parameter will replace module id above, the optional second parameter will replace everything before "in conjunction".

Exports

 * module(moduleName, moduleObject)
 * Called by a module that exports stuff. moduleName is the full id of a module, moduleObject is the object that contains all the exported stuff.

module("user.someModule", new function {    ... }; – or, when a module is dependent on another module – ... loadModule("user.otherModule", function {    ...     module("user.someModule", obj); }; ...
 * loadModule(moduleName, callback)
 * Loads the module identified by moduleName. If the module contains a module-call, the callback will be called when the module is ready to be used.
 * Syntax: myCallbackFunction(moduleObject, moduleName)
 * Note that both arguments supplied to the callback are just a convenience and not really necessary.


 * loadModules([moduleName, ...], callback)
 * Load multiple modules.


 * version
 * The version of this module as a string.


 * revision
 * The revision number – will be incremented every time something changes.

Settings

 * load
 * An array of full id's (names) of modules to load when this script is included. Modules loaded this way are guaranteed to have the functions exported by this module available.

Gerbrant = {fw: {load: [ "user.someScript", ... ]}}