This page (revision-23) was last changed on 17-Dec-2012 17:41 by constin

This page was created on 17-Dec-2012 10:00 by LukasBrehl

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
23 17-Dec-2012 17:41 1 KB constin to previous
22 17-Dec-2012 17:24 1 KB constin to previous | to last
21 17-Dec-2012 12:20 1 KB LukasBrehl to previous | to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 1 changed one line
!!! Structure of the javascript
!! Path of Javascript and CSS Files
At line 3 changed one line
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 files have to be saved in the library. The path there for Javascript files is
{{{library/KnowWEExtensions/scripts/javascriptfile.js}}}
At line 5 changed 4 lines
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.
For CSS files its:
At line 10 changed one line
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.
{{{library/KnowWEExtensions/css/cssfile.css}}}
At line 12 changed one line
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.
!! Register the Files
At line 12 added 5 lines
The files have to be registred in the plugin.xml. This happens with a parameter id line. The parameter id line is added to the desired plugin. Plugins with css or javascript files can be for example [actions|https://isci.informatik.uni-wuerzburg.de/javadoc/KnowWE/de/knowwe/core/action/Action.html], [types|https://isci.informatik.uni-wuerzburg.de/javadoc/KnowWE/de/knowwe/core/kdom/Type.html], [renderer|https://isci.informatik.uni-wuerzburg.de/javadoc/KnowWE/de/knowwe/core/kdom/rendering/Renderer.html], [toolprovider|https://isci.informatik.uni-wuerzburg.de/javadoc/KnowWE/de/knowwe/tools/ToolProvider.html] and [taghandler|https://isci.informatik.uni-wuerzburg.de/javadoc/KnowWE/de/knowwe/core/taghandler/TagHandler.html].
\\
For Javascript files it looks like:
At line 18 added 11 lines
{{{<parameter id="script" value="javascriptfile.js" />}}}
/%
For CSS files:
%%prettify
{{{<parameter id="css" value="cssfile.css" />}}}
/%
!! Example
%%prettify
At line 27 changed one line
%
/%
At line 29 changed one line
howto
howto Javascript CSS