diff options
-rw-r--r-- | freeipa.spec.in | 1 | ||||
-rw-r--r-- | install/ui/build/freeipa/Makefile.am | 1 | ||||
-rw-r--r-- | install/ui/src/freeipa/app_container.js | 31 | ||||
-rw-r--r-- | install/ui/src/freeipa/core.js | 27 | ||||
-rw-r--r-- | install/ui/src/freeipa/widget.js | 7 | ||||
-rw-r--r-- | install/ui/src/webui.profile.js | 3 | ||||
-rwxr-xr-x | install/ui/util/compile.sh | 12 | ||||
-rwxr-xr-x | install/ui/util/make-ui.sh | 1 |
8 files changed, 67 insertions, 16 deletions
diff --git a/freeipa.spec.in b/freeipa.spec.in index 088fdb6a9..bb61cfe91 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -714,6 +714,7 @@ fi %{_usr}/share/ipa/ui/js/libs/*.js %dir %{_usr}/share/ipa/ui/js/freeipa %{_usr}/share/ipa/ui/js/freeipa/app.js +%{_usr}/share/ipa/ui/js/freeipa/core.js %dir %{_usr}/share/ipa/ui/js/plugins %dir %{_usr}/share/ipa/ui/images %{_usr}/share/ipa/ui/images/*.jpg diff --git a/install/ui/build/freeipa/Makefile.am b/install/ui/build/freeipa/Makefile.am index 045a090e6..d21004d1e 100644 --- a/install/ui/build/freeipa/Makefile.am +++ b/install/ui/build/freeipa/Makefile.am @@ -3,6 +3,7 @@ NULL = appdir = $(IPA_DATA_DIR)/ui/js/freeipa app_DATA = \ app.js \ + core.js \ $(NULL) EXTRA_DIST = \ 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 diff --git a/install/ui/src/webui.profile.js b/install/ui/src/webui.profile.js index ad9b15b3a..6fd9d912c 100644 --- a/install/ui/src/webui.profile.js +++ b/install/ui/src/webui.profile.js @@ -114,6 +114,9 @@ var profile = (function(){ ], layers: { + "freeipa/core": { + include: ["freeipa/core"] + }, "freeipa/app": { include: ["freeipa/app", "freeipa/extend"] } diff --git a/install/ui/util/compile.sh b/install/ui/util/compile.sh index 55d715fa4..5c98a66e4 100755 --- a/install/ui/util/compile.sh +++ b/install/ui/util/compile.sh @@ -106,15 +106,3 @@ fi # compile using uglify.js $DIR/uglifyjs/uglify $RDIR/$RELEASE/$LAYER.js $OUTPUT_FILE - -# clean all other files -BUILD_DIR=$RDIR/$RELEASE/`echo $LAYER | cut -d/ -f 1` -LAYER_FILE=`echo $LAYER | cut -d/ -f 2`.js -rm -f $RDIR/$RELEASE/build-report.txt -pushd $BUILD_DIR - if [[ $? != 0 ]] ; then - echo "Invalid build dir: $BUILD_DIR" - exit 1 - fi - ls -1 | grep -v -e "^$LAYER_FILE$" | xargs rm -rf -popd
\ No newline at end of file diff --git a/install/ui/util/make-ui.sh b/install/ui/util/make-ui.sh index 678a08cb1..d842e955b 100755 --- a/install/ui/util/make-ui.sh +++ b/install/ui/util/make-ui.sh @@ -31,5 +31,6 @@ fi $DIR/clean.sh $DIR/build.sh webui # don't stop at error. Some dependency errors are expected. +$DIR/compile.sh --release lib --layer freeipa/core --output $IPA_DIR/core.js $DIR/compile.sh --release lib --layer freeipa/app --output $IPA_DIR/app.js $DIR/clean.sh
\ No newline at end of file |