15 Commits

Author SHA1 Message Date
Nitin Mehta
c11dbad9c9 merge master 2013-05-11 15:28:43 +05:30
Brian Federle
73d87f1ad2 UI Plugin/module API: Fix load order, refactor
-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
2013-04-18 13:59:20 -07:00
Brian Federle
6babaf9616 Add UI 'module' API
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.
2013-04-18 12:52:55 -07:00
Brian Federle
fca7b3ef22 Rename widget 'plugins' to 'pluginListing'
For better clarity on its function, rename the 'plugins' widget to 'pluginListing,'
as it does not handle the actual plugin logic.
2013-04-18 10:49:45 -07:00
Brian Federle
48118a4f9c Add license headers to new JS files 2013-02-13 14:59:01 -08:00
Brian Federle
6e02fb96c9 UI Plugins, API call helper: Add 'pollAyncJobResult' helper, allow passing data 2013-02-12 16:10:40 -08:00
Brian Federle
5b8e4b9fd9 UI Plugin API: Implement 'apiCall' helper
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.
2013-02-12 15:21:29 -08:00
Brian Federle
690dd66d3e UI plugin: Show custom icon
Show custom icon '<pluginName>/icon.png' on side nav bar (if plugin
added new section), and on plugin listing.
2013-01-29 16:05:48 -08:00
Brian Federle
0f6eb2f53d UI plugins: Add localization strings 2013-01-29 15:36:02 -08:00
Brian Federle
806105f9a1 UI plugins: Dynamically load CSS
Adds a CSS file <pluginName>.css to the plugin structure, which allows
developer to specify custom CSS to be loaded after their JS code.
2013-01-29 13:56:36 -08:00
Brian Federle
1a3ea28243 UI plugins API: addSection method
Adds 'addSection' method to UI plugins, which will add a new top-level
section. It follows the same syntax used by the existing sections in
the UI.
2012-12-20 13:27:37 -08:00
Brian Federle
347ac311a0 UI Plugin: Use new format
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
    //
  };
2012-12-20 11:55:44 -08:00
Brian Federle
59c77b4850 Add plugin loading functionality and basic framework
Dynamically load UI plugins via require.js

Plugin code uses the following format:

(function (cloudStack) {
  var testPlugin1 = function(plugin) {
    // Plugin code goes here
  };

  cloudStack.plugin({
    id: 'testPlugin1',
    title: 'Test Plugin 1',
    desc: 'Sample plugin 1',
    load: testPlugin1
  });
}(cloudStack));
2012-12-19 15:47:25 -08:00
Brian Federle
f0a6e86e14 Add/style basic plugin listing 2012-12-19 15:04:47 -08:00
Brian Federle
bd9bedac8a Fix path for plugins.js 2012-12-19 14:03:31 -08:00