Blog.

JavaScript Plugin File Pattern

[su_icon_text icon=”icon: info-circle” icon_color=”#5b63df” class=”saki-info-box”]Code in this post can be obsolete, however, principles and theory may still apply.[/su_icon_text]
// vim: sw=4:ts=4:nu:nospell:fdc=4
/**
 * A Plugin
 *
 * @author    Ing. Jozef Sakáloš
 * @copyright (c) 2008, by Ing. Jozef Sakáloš
 * @date      3. April 2008
 * @version   $Id$
 *
 * @license plugin.js is licensed under the terms of the Open Source
 * LGPL 3.0 license. Commercial use is permitted to the extent that the 
 * code/component(s) do NOT become part of another Open Source or Commercially
 * licensed development library or toolkit without explicit permission.
 * 
 * License details: http://www.gnu.org/licenses/lgpl.html
 */

/*global Ext */

/**
 * @class APlugin
 * @extends Ext.util.Observable
 *
 * Creates new APlugin object
 * @constructor
 * @param {Object} config The config object
 */
APlugin = function(config) {
    Ext.apply(this, config);

    // call parent
    APlugin.superclass.constructor.call(this);

}; // eo constructor

Ext.extend(APlugin, Ext.util.Observable, {

    // defaults - can be configured from outside

    init:function(parent) {
        this.parent = parent;

        // rest of plugin init code

    } // eo function init

    // other plugin functions

}); // eo extend

// register xtype
Ext.reg('apluginxtype', APlugin); 

// eof
saki
Follow me:
Latest posts by saki (see all)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your username and password to log into your account. Don't have an account? Sign up.

Want to collaborate on an upcoming project?