Plugins

Usage

Installation

To install a plugin, just put the files in the root/plugins path.

Development

The plugin must respect the following architecture :

plugin-name/
        -- plugin/
        -- android/
        -- windows/
plugin
Rizla and Firefox OS plugin files (javascript).
android
Android plugin files.
windows
Windows phone plugin files.

Because Firefox OS development use HTML/Javascript, no external files is needed.

Javascript

The first step in plugins development is to write a central javascript file in the root/plugins path. The name of the file must be the name of the plugin. So let’s see an minimal plugin :

Rizla.plugins.Alert = {
        // rizla function
        name : 'Alert',
        descript : 'This a basic plugin that does nothing except show alert',
        version : '0.1',
        css : '../style/main.css',

        onInit : function(){
                switch (Rizla.platform){
                        case "android":
                                Android.alert("Plugin Alert initialisation");
                                break;
                        default:
                                alert("Plugin Alert initialisation");
                                break;
                }
        },

        // At this point you can define the specific plugin function
};

Fields

name
Name of the plugin.
description
A short description of what the plugin do.
version
Current release of the plugin.
css
Here put the css files, they are loaded automatically when you start the application.

Function

onInit()
Called when the application loads.

Android

Windows

Built-in plugins

rizla-core

List objects must be in a section that contains an attribute data-type="list".

<section data-type="list">
        <ul>
                <li>
                        <h5>Item title</h5>
                        <p>Some text</p>
                </li>
                <li>
                        <h1>Big title</h1>
                </li>
        </ul>
</section>

rizla-extra

Table Of Contents

Related Topics

This Page