English Deutsch

KSS extension with custom plugins

This part is adapted from the original KSS documentation, written by the KSS contributors.

KSS has a plugin architecture. Apart from the core that is parsing the .kss files and binding them to nodes, communicating with the server and executing the KSS commands, almost every component, incuding actions, events, parameter providers, selectors is designed to be pluggable.

The KSS plugin API makes it possible to create all these components and register them to KSS.

The plugin development is a seldom needed and specialized task. To be able to do it, you must be familiar with Javascript and KSS.

Creating an action

An action is a Javascript function that is called when the action is executed. It receives the node and a parameter object:

kss.registerActionProvider('replaceInnerHTML', function(node, params) {
    node.innerHTML = params.html;
});

Creating a parameter provider

A parameter provider is a Javascript function that is called for each parameter for an action. It receives the node and all arguments:

kss.registerParameterProvider('nodeAttr', function(node, name) {
    return node.getAttribute(name);
});

Creating a custom event binder

TODO

Share it Facebook Twitter Email AddThis