diff --git a/pom.xml b/pom.xml
index dbc39076f2d..7d5b4c3bdef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -237,6 +237,22 @@
install
+
+ org.apache.maven.plugins
+ maven-release-plugin
+ 2.2.1
+
+
+ default
+
+ perform
+
+
+ pom.xml
+
+
+
+
diff --git a/ui/scripts/plugins.js b/ui/scripts/plugins.js
index 9d1991cc759..122f4a03491 100644
--- a/ui/scripts/plugins.js
+++ b/ui/scripts/plugins.js
@@ -15,7 +15,9 @@
// specific language governing permissions and limitations
// under the License.
(function($, cloudStack, require) {
- if (!cloudStack.pluginAPI) cloudStack.pluginAPI = {};
+ if (!cloudStack.pluginAPI) {
+ cloudStack.pluginAPI = {};
+ }
var loadCSS = function(path) {
var $link = $('');
@@ -40,7 +42,7 @@
error: function(json) {
args.error(parseXMLHttpResponse(json));
}
- })
+ });
},
addSection: function(section) {
cloudStack.sections[section.id] = $.extend(section, {
@@ -58,49 +60,40 @@
show: cloudStack.uiCustom.pluginListing
};
- // Load plugins
- $(cloudStack.plugins).map(function(index, pluginID) {
- var basePath = 'plugins/' + pluginID + '/';
- var pluginJS = basePath + pluginID + '.js';
- var configJS = basePath + 'config.js';
- var pluginCSS = basePath + pluginID + '.css';
+ // Load
+ $(['modules', 'plugins']).each(function() {
+ var type = this;
+ var paths = $(cloudStack[type]).map(function(index, id) {
+ return type + '/' + id + '/' + id;
+ }).toArray();
- require([pluginJS], function() {
- require([configJS]);
- loadCSS(pluginCSS);
+ // Load modules
+ require(
+ paths,
+ function() {
+ $(cloudStack[type]).map(function(index, id) {
+ var basePath = type + '/' + id + '/';
+ var css = basePath + id + '.css';
+ var configJS = type == 'plugins' ? basePath + 'config' : null;
- // Execute plugin
- cloudStack.plugins[pluginID](
- $.extend(true, {}, cloudStack.pluginAPI, {
- pluginAPI: {
- extend: function(api) {
- cloudStack.pluginAPI[pluginID] = api;
- }
+ if (configJS) {
+ // Load config metadata
+ require([configJS]);
}
- })
- );
- });
- });
- // Load modules
- $(cloudStack.modules).map(function(index, moduleID) {
- var basePath = 'modules/' + moduleID + '/';
- var moduleJS = basePath + moduleID + '.js';
- var moduleCSS = basePath + moduleID + '.css';
-
- require([moduleJS], function() {
- loadCSS(moduleCSS);
-
- // Execute module
- cloudStack.modules[moduleID](
- $.extend(true, {}, cloudStack.pluginAPI, {
- pluginAPI: {
- extend: function(api) {
- cloudStack.pluginAPI[moduleID] = api;
- }
- }
- })
- );
- });
+ // Execute module
+ cloudStack[type][id](
+ $.extend(true, {}, cloudStack.pluginAPI, {
+ pluginAPI: {
+ extend: function(api) {
+ cloudStack.pluginAPI[id] = api;
+ }
+ }
+ })
+ );
+ loadCSS(css);
+ });
+ }
+ );
});
}(jQuery, cloudStack, require));