summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2014-06-05 17:12:41 +0200
committerPetr Vobornik <pvoborni@redhat.com>2014-06-30 12:27:05 +0200
commit46a42de5324390496fa70984c2d8cef7a6251b7a (patch)
tree6103453bf0d797f3a7c4d87dee4ed5b808866d12 /install/ui/src/freeipa
parentc2c1131a7a3745a3bdcf9cea8a5c8203e3ae555b (diff)
downloadfreeipa-46a42de5324390496fa70984c2d8cef7a6251b7a.tar.gz
freeipa-46a42de5324390496fa70984c2d8cef7a6251b7a.tar.xz
freeipa-46a42de5324390496fa70984c2d8cef7a6251b7a.zip
webui: layer for standalone pages which use WebUI framework
Current compiled Web UI layer (app.js) contains every FreeIPA plugin and not just the UI framework. It's not possible to start just a simple facet. This commit creates a basis for a layer (core.js) which contains only framework code and not entity related code. Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
Diffstat (limited to 'install/ui/src/freeipa')
-rw-r--r--install/ui/src/freeipa/app_container.js31
-rw-r--r--install/ui/src/freeipa/core.js27
-rw-r--r--install/ui/src/freeipa/widget.js7
3 files changed, 61 insertions, 4 deletions
diff --git a/install/ui/src/freeipa/app_container.js b/install/ui/src/freeipa/app_container.js
index ec2d71e44..7f5aacca0 100644
--- a/install/ui/src/freeipa/app_container.js
+++ b/install/ui/src/freeipa/app_container.js
@@ -24,9 +24,10 @@ define([
'dojo/when',
'./plugin_loader',
'./phases',
+ './reg',
'./Application_controller',
'exports'
-],function(lang, Deferred, when, plugin_loader, phases, Application_controller, app) {
+],function(lang, Deferred, when, plugin_loader, phases, reg, Application_controller, app) {
/**
* Application wrapper
@@ -84,11 +85,39 @@ define([
}));
},
+ simple_mode_phases: function() {
+
+ phases.on('init', lang.hitch(this, function() {
+ var app = this.app = new this.App_class();
+ app.init();
+ return app;
+ }));
+
+ phases.on('runtime', lang.hitch(this, function() {
+ var d = new Deferred();
+ var facet = reg.facet.get(this.target_facet);
+ if (!facet) {
+ window.console.error('Target facet not found: '+this.target_facet);
+ } else {
+ this.app.show_facet(facet);
+ }
+ return d.promise;
+ }));
+ },
+
run: function() {
when(plugin_loader.load_plugins(), lang.hitch(this, function() {
this.register_phases();
phases.controller.run();
}));
+ },
+
+ run_simple: function(facet) {
+ this.target_facet = facet;
+ when(plugin_loader.load_plugins(), lang.hitch(this, function() {
+ this.simple_mode_phases();
+ phases.controller.run();
+ }));
}
});
diff --git a/install/ui/src/freeipa/core.js b/install/ui/src/freeipa/core.js
new file mode 100644
index 000000000..d906ec916
--- /dev/null
+++ b/install/ui/src/freeipa/core.js
@@ -0,0 +1,27 @@
+/* Authors:
+ * Petr Vobornik <pvoborni@redhat.com>
+ *
+ * Copyright (C) 2012 Red Hat
+ * see file 'COPYING' for use and warranty information
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+define([
+ './app_container',
+ './plugins/sync_otp',
+ './plugins/login'
+],function(app_container) {
+ return app_container;
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 3aba7da52..2321edabf 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -32,6 +32,7 @@ define(['dojo/_base/array',
'dojo/topic',
'./builder',
'./datetime',
+ './entity',
'./ipa',
'./jquery',
'./navigation',
@@ -39,10 +40,11 @@ define(['dojo/_base/array',
'./reg',
'./rpc',
'./text',
- './util'
+ './util',
+ 'exports'
],
function(array, lang, Evented, has, keys, on, string, topic, builder,
- datetime, IPA, $, navigation, phases, reg, rpc, text, util) {
+ datetime, entity_mod, IPA, $, navigation, phases, reg, rpc, text, util, exp) {
/**
* Widget module
@@ -54,7 +56,6 @@ define(['dojo/_base/array',
* @class widget
* @singleton
*/
-var exp = {};
/**
* Width of column which contains only checkbox