Alter the JavaScript Application routing: comparison of v...
Versions Compared
Old Version 11
changes.mady.by.user Philippe Vincent-Royol
Saved on Jan 14, 2016
compared with
New Version Current
changes.mady.by.user Damien Pobel
Saved on Mar 04, 2016
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Comment: makes clear the 'ezconf' namespace prefix is just an example
...
| Code Block | ||
|---|---|---|
|
||
system:
default:
yui:
modules:
# use your own prefix, not "ez-"
ezconf-listapplugin: # module identifier
dependencyOf: ['ez-platformuiapp']
requires: ['ez-pluginregistry', 'plugin', 'base'] # depends on the plugin code
path: %extending_platformui.public_dir%/js/apps/plugins/ezconf-listappplugin.js
|
...
| Code Block | ||||||
|---|---|---|---|---|---|---|
|
||||||
YUI.add('ezconf-listapplugin', function (Y) {
// Good practices:
// * use a custom namespace. 'eZConf' is used as an example here.
// * put the plugins in a 'Plugin' sub namespace
Y.namespace('eZConf.Plugin');
Y.eZConf.Plugin.ListAppPlugin = Y.Base.create('ezconfListAppPlugin', Y.Plugin.Base, [], {
initializer: function () {
var app = this.get('host'); // the plugged object is called host
console.log("Hey, I'm a plugin for PlatformUI App!");
console.log("And I'm plugged in ", app);
},
}, {
NS: 'ezconfTypeApp' // don't forget that
});
// registering the plugin for the app
// with that, the plugin is automatically instantiated and plugged in
// 'platformuiApp' component.
Y.eZ.PluginRegistry.registerPlugin(
Y.eZConf.Plugin.ListAppPlugin, ['platformuiApp']
);
});
|
...
Comments
Add a comment