client/src/models/applet.js
function (applet_object, applet_name) {
        if (typeof applet_object === 'object') {
            // Make sure this is a valid Applet
            if (applet_object.get || applet_object.extend) {

                // Try find a title for the applet
                this.set('title', applet_object.get('title') || _kiwi.global.i18n.translate('client_models_applet_unknown').fetch());

                // Update the tabs title if the applet changes it
                applet_object.bind('change:title', function (obj, new_value) {
                    this.set('title', new_value);
                }, this);

                // If this applet has a UI, add it now
                this.view.$el.html('');
                if (applet_object.view) {
                    this.view.$el.append(applet_object.view.$el);
                }

                // Keep a reference to this applet
                this.loaded_applet = applet_object;

                this.loaded_applet.trigger('applet_loaded');
            }

        } else if (typeof applet_object === 'string') {
            // Treat this as a URL to an applet script and load it
            this.loadFromUrl(applet_object, applet_name);
        }

        return this;
    }
function (applet_object, applet_name) {
        if (typeof applet_object === 'object') {
            // Make sure this is a valid Applet
            if (applet_object.get || applet_object.extend) {

                // Try find a title for the applet
                this.set('title', applet_object.get('title') || _kiwi.global.i18n.translate('client_models_applet_unknown').fetch());

                // Update the tabs title if the applet changes it
                applet_object.bind('change:title', function (obj, new_value) {
                    this.set('title', new_value);
                }, this);

                // If this applet has a UI, add it now
                this.view.$el.html('');
                if (applet_object.view) {
                    this.view.$el.append(applet_object.view.$el);
                }

                // Keep a reference to this applet
                this.loaded_applet = applet_object;

                this.loaded_applet.trigger('applet_loaded');
            }

        } else if (typeof applet_object === 'string') {
            // Treat this as a URL to an applet script and load it
            this.loadFromUrl(applet_object, applet_name);
        }

        return this;
    }
function ( applet_object , applet_name ) { if ( typeof applet_object === 'object' ) { // Make sure this is a valid Applet
 if ( applet_object . get || applet_object . extend ) { // Try find a title for the applet
 this . set ( 'title' , applet_object . get ( 'title' ) || _kiwi . global . i18n . translate ( 'client_models_applet_unknown' ) . fetch ( ) ) ; // Update the tabs title if the applet changes it
 applet_object . bind ( 'change:title' , function ( obj , new_value ) { this . set ( 'title' , new_value ) ; } , this ) ; // If this applet has a UI, add it now
 this . view . $el . html ( '' ) ; if ( applet_object . view ) { this . view . $el . append ( applet_object . view . $el ) ; } // Keep a reference to this applet
 this . loaded_applet = applet_object ; this . loaded_applet . trigger ( 'applet_loaded' ) ; } } else if ( typeof applet_object === 'string' ) { // Treat this as a URL to an applet script and load it
 this . loadFromUrl ( applet_object , applet_name ) ; } return this ; }
Load an applet within this panel
Load an applet within this panel