AppSuite:Writing a notification area plugin: Difference between revisions

From Open-Xchange
No edit summary
(Replaced content with "The content on this page has moved to https://documentation.open-xchange.com/latest/ui/customize/notifications.html Note: Open-Xchange is in the process of migrating all...")
 
(41 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="title">Writing a plugin for the notification area</div>
The content on this page has moved to https://documentation.open-xchange.com/latest/ui/customize/notifications.html


'''Abstract:''' This article is a step by step tutorial to build your own notification plugin.
Note: Open-Xchange is in the process of migrating all its technical documentation to a new and improved documentation system (documentation.open-xchange.com). Please note as the migration takes place more information will be available on the new system and less on this system. Thank you for your understanding during this period of transition.
These plugins can be used for various purposes, for example reminding the user of something or showing him new invitations.
 
__TOC__
 
==Basic Notification==
 
This is the most basic code for a notification plugin, it doesn't have api suppport or other things but should work:
 
<pre class="language-javascript">
define('plugins/notifications/tutorial/register', [
    'io.ox/core/extensions',
    'io.ox/core/notifications/subview'
], function (ext, Subview) {
 
    'use strict';
 
    ext.point('io.ox/core/notifications/tutorial/item').extend({
        draw: function (baton) {
            this.append( $('<span>').text('hello world'));
        }
    });
 
    ext.point('io.ox/core/notifications/register').extend({
        id: 'tutorialplugin',
        index: 300,
        register: function () {
            var options = {
                    id: 'io.ox/tutorialplugin',
                    //#. Invitations (notifications) about appointments
                    title: 'Test Notifications',
                    extensionPoints: {
                        item: 'io.ox/core/notifications/tutorial/item'
                    },
                },
                subview  = new Subview(options);
 
            subview.resetNotifications({id: myNotification1});
        }
    });
 
    return true;
});
</pre>

Latest revision as of 09:36, 22 May 2017

The content on this page has moved to https://documentation.open-xchange.com/latest/ui/customize/notifications.html

Note: Open-Xchange is in the process of migrating all its technical documentation to a new and improved documentation system (documentation.open-xchange.com). Please note as the migration takes place more information will be available on the new system and less on this system. Thank you for your understanding during this period of transition.