Skip to content
felipenmoura edited this page Jan 24, 2013 · 2 revisions

Addons can make a lot of difference for you and your audience! Basically, they can apply changes to your slides, to the HTML structure and to the Power Polygon itself.

At any time, you can use the API methods.
[API Power Polygon](API - Power Polygon)

The user simply has to import the script of your addon to have it working on their presentation.
To create your addon, please follow this pattern:

window.PPW.extend("myAddon", (function(){

    // Your private vars.
    var _ppw; // will referrer to the global PPW.
    
    // any method of yors(how many you want)
    var _doSomething= function(){
        // do ... something!
    };

    // the constructor
    var _setup= function(ppw){
        _ppw= ppw;
    };

    // automatically extended
    return {
        onload: _setup,
        onsplashscreen: _doSomething,
        // .... all the available event listeners for Power Polygon.
    };
    
})());

The returned object from the definition of your addon is used to trigger the events that your addon expects to use. That is how you can easily listen to any event Power Polygon supports.
All the methods inside your addon is under your control, create as many as you need.

In case you need to load an extra script file to have your addon working, you can simply use jQuery, once it is a dependence for Power Polygon to work. Like this: $.getScript("script-file.js", yourCallbackFunction);

Clone this wiki locally