Structure of the javascript#

The javascript content is now structured into namespaces. This was necessary to avoid conflicts between javascript APIs used by JSPWiki itself and source code written for KnowWE. Also the namespace concept introduces clarity into the javascript code and avoids conflicts between KnowWE plugins maybe using the same function name for different purposes.

The KnowWE javascript code knows the following three core namespaces:

  • KNOWWE.helper: The helper namespace contains functions of often used javascript code like a DOM element selector or an AJAX request function.
  • KNOWWE.core: The core namespace stores all the javascript functionality used in the core KnowWE without any plugins.
  • KNOWWE.plugin: The plugin namespace holds the complete code from the plugins that extend KnowWE.

The composition of the namespaces is not further structured. But every namespace has a "init" function to summarize functions/actions that are executed during page load and shortly after. This is also only due clarity.

If you write javascript code for KnowWE please use one of the above namespace. New namespaces can also be introduced without any problems. For further information about the content of the namespaces please read the javascript documentation in KnowWE/src/resources/doc/javascript in the SVN repository.