For any plugin/module, allow including additional JS dependencies via
new plugin syntax.
To include JS files, instead of passing a function directly, pass an
array with the first element being a sub-list of the includes:
cloudStack.plugin.myPlugin = [
['file1', 'file2', 'fileN' ...], // These will be loaded before
// plugin is executed
function(plugin) { // The plugin entry point
...
}
];
-- Where each item represents a JS file relative to the plugin folder
and without the .js extension. Sub-folders are also supported, i.e.,
'subfolder/file1'
Due to usability issues, any UI plugins that add a main section (via the
addSection function) will now be shown in the 'Plugins' area by clicking
on the relevant tile. This is to prevent overflow of the side nav bar
caused by too many plugins being loaded.
Allows UI plugins to contribute their own internationalized strings to
the global js dictionary. Each plugin would define a dictionary.js and
several dictionary_<locale>.js files. As each plugin is loaded, the
appropriate plugin dictionary is loaded into the global js
dictionary (with the global dictionary taking precedence in the event
of a conflict).
Original author: Chris Suich <chris.suich@netapp.com>
Reviewed by: Brian Federle <brian.federle@citrix.com>
Fixes potential issue where plugins could load after cloudStack UI is initialized,
preventing their functionality from showing up.
Now, the main UI is only loaded after all plugins have loaded; this is via
'cloudStack.pluginReady' event.
-Fixes issue with load order, where plugin's initialization function were not called
in order of the list
-Refactor so that modules and plugins are loaded via the same block,
to avoid redundant code
-Load modules before plugins
Add a variant to a plugin, called a 'module.' It is designed for
features that are build-in to the standard UI (i.e., not installed
dynamically), but can still utilize the modular nature of UI
plugins. It works exactly the same way as a plugin, except:
-Modules are added to modules/ folder
-Modules are registered in modules/modules.js
-No config.js (no need for metadata, since they are built-in features)
- /ui/modules/ folder will not be touched by the build system, so any modules
are committed directly to the ui/ folder. In other words, modules are
not installed automatically.
Adds a helper method to standardize how plugin writers handle server calls,
without having to directly invoke jQuery.ajax. It will correctly sanitize data
and ensure all required parameters (e.g., session key data) are passed.
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
//
};