mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Define plugins as namespaced objects instead of as function calls. This
is easier to implement and manage by the framework.
New format changes for defining plugins:
Now create 2 JS files in plugin folder:
-config.js
-[pluginName].js
plugins.js (listing) format:
cloudStack.plugins = [
'testPlugin'
];
config.js format:
cloudStack.plugins.testPlugin.config = {
title: 'Test Plugin',
desc: 'Sample plugin'
};
[pluginName].js format:
cloudStack.plugins.testPlugin = function(plugin) {
//
// Plugin code goes here
//
};
7 lines
141 B
JavaScript
7 lines
141 B
JavaScript
(function (cloudStack) {
|
|
cloudStack.plugins.testPlugin = function(plugin) {
|
|
//
|
|
// Plugin code goes here
|
|
//
|
|
};
|
|
}(cloudStack)); |