summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-11-12 18:05:13 +0100
committerPetr Vobornik <pvoborni@redhat.com>2013-01-18 15:10:36 +0100
commit5e90c9884977b07be8cd0d4f6377b633f29e4ad1 (patch)
tree6ab0a8f166cef39558078762d0bce42c8a00eeeb /install/ui/src/freeipa
parente3ce3e4f393d45d4e611a129db6cb7abfa5ad716 (diff)
downloadfreeipa-5e90c9884977b07be8cd0d4f6377b633f29e4ad1.tar.gz
freeipa-5e90c9884977b07be8cd0d4f6377b633f29e4ad1.tar.xz
freeipa-5e90c9884977b07be8cd0d4f6377b633f29e4ad1.zip
Change Web UI sources to simple AMD modules
Web UI sources were wrapped by AMD definition. Listed dependencies were changed accordingly. https://fedorahosted.org/freeipa/ticket/112
Diffstat (limited to 'install/ui/src/freeipa')
-rw-r--r--install/ui/src/freeipa/aci.js8
-rw-r--r--install/ui/src/freeipa/add.js7
-rw-r--r--install/ui/src/freeipa/app.js126
-rw-r--r--install/ui/src/freeipa/association.js10
-rw-r--r--install/ui/src/freeipa/automember.js10
-rw-r--r--install/ui/src/freeipa/automount.js9
-rwxr-xr-xinstall/ui/src/freeipa/certificate.js9
-rw-r--r--install/ui/src/freeipa/details.js7
-rw-r--r--install/ui/src/freeipa/dialog.js5
-rw-r--r--install/ui/src/freeipa/dns.js12
-rw-r--r--install/ui/src/freeipa/entitle.js9
-rw-r--r--install/ui/src/freeipa/entity.js11
-rw-r--r--install/ui/src/freeipa/facet.js9
-rw-r--r--install/ui/src/freeipa/field.js8
-rw-r--r--install/ui/src/freeipa/group.js8
-rw-r--r--install/ui/src/freeipa/hbac.js8
-rw-r--r--install/ui/src/freeipa/hbactest.js8
-rw-r--r--install/ui/src/freeipa/host.js9
-rw-r--r--install/ui/src/freeipa/hostgroup.js8
-rw-r--r--install/ui/src/freeipa/idrange.js8
-rw-r--r--install/ui/src/freeipa/ipa.js7
-rw-r--r--install/ui/src/freeipa/jquery.js26
-rw-r--r--install/ui/src/freeipa/json2.js27
-rw-r--r--install/ui/src/freeipa/navigation.js5
-rw-r--r--install/ui/src/freeipa/net.js7
-rw-r--r--install/ui/src/freeipa/netgroup.js8
-rw-r--r--install/ui/src/freeipa/policy.js9
-rw-r--r--install/ui/src/freeipa/rule.js8
-rw-r--r--install/ui/src/freeipa/search.js9
-rw-r--r--install/ui/src/freeipa/selinux.js10
-rw-r--r--install/ui/src/freeipa/serverconfig.js8
-rw-r--r--install/ui/src/freeipa/service.js9
-rw-r--r--install/ui/src/freeipa/sudo.js8
-rw-r--r--install/ui/src/freeipa/trust.js8
-rw-r--r--install/ui/src/freeipa/user.js10
-rw-r--r--install/ui/src/freeipa/webui.js81
-rw-r--r--install/ui/src/freeipa/widget.js7
37 files changed, 350 insertions, 186 deletions
diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js
index bd7de19ab..383848ec6 100644
--- a/install/ui/src/freeipa/aci.js
+++ b/install/ui/src/freeipa/aci.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Adam Young <ayoung@redhat.com>
* Endi S. Dewata <edewata@redhat.com>
@@ -21,7 +19,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.aci = {};
@@ -895,3 +894,6 @@ IPA.register('privilege', IPA.aci.privilege_entity);
IPA.register('role', IPA.aci.role_entity);
IPA.register('selfservice', IPA.aci.selfservice_entity);
IPA.register('delegation', IPA.aci.delegation_entity);
+
+return IPA.aci;
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/add.js b/install/ui/src/freeipa/add.js
index 6d3f454be..1b4a1ae59 100644
--- a/install/ui/src/freeipa/add.js
+++ b/install/ui/src/freeipa/add.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Pavel Zuna <pzuna@redhat.com>
* Endi Sukma Dewata <edewata@redhat.com>
@@ -21,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js */
+define(['./ipa', './jquery', './field', './widget', './dialog'], function(IPA, $) {
IPA.entity_adder_dialog = function(spec) {
@@ -205,3 +203,6 @@ IPA.entity_adder_dialog = function(spec) {
return that;
};
+
+return IPA.entity_adder_dialog;
+});
diff --git a/install/ui/src/freeipa/app.js b/install/ui/src/freeipa/app.js
new file mode 100644
index 000000000..9d89c1aed
--- /dev/null
+++ b/install/ui/src/freeipa/app.js
@@ -0,0 +1,126 @@
+/* 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/>.
+*/
+
+//
+// AMD Wrapper for json2 library
+//
+
+define([
+ //core
+ './ipa',
+ './jquery',
+ './navigation',
+ './webui',
+ //only entities
+ './aci',
+ './automember',
+ './automount',
+ './dns',
+ './group',
+ './hbac',
+ './hbactest',
+ './hostgroup',
+ './host',
+ './idrange',
+ './netgroup',
+ './policy',
+ './rule',
+ './selinux',
+ './serverconfig',
+ './service',
+ './sudo',
+ './trust',
+ './user',
+ 'dojo/domReady!'
+],function(IPA, $) {
+
+ /* main loop (hashchange event handler) */
+ function window_hashchange(evt){
+ IPA.nav.update();
+ }
+
+ function create_navigation() {
+ var whoami = IPA.whoami;
+ var factory;
+
+
+ if (whoami.hasOwnProperty('memberof_group') &&
+ whoami.memberof_group.indexOf('admins') !== -1) {
+ factory = IPA.admin_navigation;
+ } else if (whoami.hasOwnProperty('memberofindirect_group')&&
+ whoami.memberofindirect_group.indexOf('admins') !== -1) {
+ factory = IPA.admin_navigation;
+ } else if (whoami.hasOwnProperty('memberof_role') &&
+ whoami.memberof_role.length > 0) {
+ factory = IPA.admin_navigation;
+ } else if (whoami.hasOwnProperty('memberofindirect_role') &&
+ whoami.memberofindirect_role.length > 0) {
+ factory = IPA.admin_navigation;
+ } else {
+ factory = IPA.self_serv_navigation;
+ }
+
+ return factory({
+ container: $('#navigation'),
+ content: $('#content')
+ });
+ }
+
+
+ function init_on_success(data, text_status, xhr) {
+ $(window).bind('hashchange', window_hashchange);
+
+ var whoami = IPA.whoami;
+ IPA.whoami_pkey = whoami.uid[0];
+ $('#loggedinas .login').text(whoami.cn[0]);
+ $('#loggedinas a').fragment(
+ {'user-facet': 'details', 'user-pkey': IPA.whoami_pkey}, 2);
+
+ $('#logout').click(function() {
+ IPA.logout();
+ return false;
+ }).text(IPA.messages.login.logout);
+
+ $('.header-loggedinas').css('visibility','visible');
+ IPA.update_password_expiration();
+
+ IPA.nav = create_navigation();
+ IPA.nav.create();
+ IPA.nav.update();
+
+ $('#login_header').html(IPA.messages.login.header);
+ }
+
+
+ function init_on_error(xhr, text_status, error_thrown) {
+ var container = $('#content').empty();
+ container.append('<p>Error: '+error_thrown.name+'</p>');
+ container.append('<p>'+error_thrown.message+'</p>');
+ }
+
+ return {
+ run: function() {
+ IPA.init({
+ on_success: init_on_success,
+ on_error: init_on_error
+ });
+ }
+ };
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/association.js b/install/ui/src/freeipa/association.js
index 70b8e9f1e..c6b9e5a4e 100644
--- a/install/ui/src/freeipa/association.js
+++ b/install/ui/src/freeipa/association.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Adam Young <ayoung@redhat.com>
* Petr Vobornik <pvoborni@redhat.com>
@@ -21,10 +19,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js */
/* CURRENTLY ALSO REQUIRES search.js, because it reuses it's code to create
* the AssociationList elements; IT NEEDS IT'S OWN CODE! */
+define(['./ipa', './jquery', './search', './dialog'], function(IPA, $) {
+
IPA.associator = function (spec) {
spec = spec || {};
@@ -1386,4 +1385,7 @@ IPA.attr_read_only_evaluator = function(spec) {
};
return that;
-}; \ No newline at end of file
+};
+
+return {};
+});
diff --git a/install/ui/src/freeipa/automember.js b/install/ui/src/freeipa/automember.js
index 6f8eba956..2d61f7ebf 100644
--- a/install/ui/src/freeipa/automember.js
+++ b/install/ui/src/freeipa/automember.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Petr Vobornik <pvoborni@redhat.com>
*
@@ -20,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.automember = {};
@@ -676,4 +675,7 @@ IPA.automember.default_group_widget = function(spec) {
};
-IPA.register('automember', IPA.automember.entity); \ No newline at end of file
+IPA.register('automember', IPA.automember.entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/automount.js b/install/ui/src/freeipa/automount.js
index 3a4491d8b..6e8547c7f 100644
--- a/install/ui/src/freeipa/automount.js
+++ b/install/ui/src/freeipa/automount.js
@@ -1,6 +1,3 @@
-/*jsl:import ipa.js */
-/*jsl:import search.js */
-
/* Authors:
* Adam Young <ayoung@redhat.com>
*
@@ -21,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.automount = {};
@@ -352,3 +350,6 @@ IPA.automount.key_search_facet = function(spec) {
IPA.register('automountlocation', IPA.automount.location_entity);
IPA.register('automountmap', IPA.automount.map_entity);
IPA.register('automountkey', IPA.automount.key_entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/certificate.js b/install/ui/src/freeipa/certificate.js
index 782033db1..f7bc84359 100755
--- a/install/ui/src/freeipa/certificate.js
+++ b/install/ui/src/freeipa/certificate.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Endi Sukma Dewata <edewata@redhat.com>
* Petr Vobornik <pvoborni@redhat.com>
@@ -21,6 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+define(['./ipa', './jquery', './dialog'], function(IPA, $) {
+
IPA.cert = {};
IPA.cert.BEGIN_CERTIFICATE = '-----BEGIN CERTIFICATE-----';
@@ -921,4 +921,7 @@ IPA.cert.status_field = function(spec) {
};
IPA.widget_factories['certificate_status'] = IPA.cert.status_widget;
-IPA.field_factories['certificate_status'] = IPA.cert.status_field; \ No newline at end of file
+IPA.field_factories['certificate_status'] = IPA.cert.status_field;
+
+return {};
+});
diff --git a/install/ui/src/freeipa/details.js b/install/ui/src/freeipa/details.js
index c3e84e434..e8f1e86d9 100644
--- a/install/ui/src/freeipa/details.js
+++ b/install/ui/src/freeipa/details.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Pavel Zuna <pzuna@redhat.com>
* Adam Young <ayoung@redhat.com>
@@ -25,7 +23,7 @@
/* IPA Object Details - populating definiton lists from entry data */
-/* REQUIRES: ipa.js */
+define(['./ipa', './jquery', './facet', './add'], function(IPA, $) {
IPA.expanded_icon = 'expanded-icon';
IPA.collapsed_icon = 'collapsed-icon';
@@ -1237,3 +1235,6 @@ IPA.disabled_summary_cond = function() {
state: ['disabled']
};
};
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/dialog.js b/install/ui/src/freeipa/dialog.js
index 4e603155a..f2326b321 100644
--- a/install/ui/src/freeipa/dialog.js
+++ b/install/ui/src/freeipa/dialog.js
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: widget.js, details.js */
+define(['./ipa', './jquery', './field', './widget'], function(IPA, $) {
IPA.opened_dialogs = {
@@ -847,3 +847,6 @@ IPA.confirm_mixin = function() {
}
};
};
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/dns.js b/install/ui/src/freeipa/dns.js
index d08f4140b..920bbd00c 100644
--- a/install/ui/src/freeipa/dns.js
+++ b/install/ui/src/freeipa/dns.js
@@ -1,7 +1,3 @@
-/*jsl:import ipa.js */
-/*jsl:import search.js */
-/*jsl:import net.js */
-
/* Authors:
* Adam Young <ayoung@redhat.com>
* Petr Vobornik <pvoborni@redhat.com>
@@ -23,8 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js,
- * net.js, widget.js */
+
+define(['./ipa', './jquery', './net', './details', './search', './association',
+ './entity'], function(IPA, $, NET) {
IPA.dns = {
zone_permission_name: 'Manage DNS zone ${dnszone}'
@@ -2550,3 +2547,6 @@ IPA.network_validator = function(spec) {
IPA.register('dnsconfig', IPA.dns.config_entity);
IPA.register('dnszone', IPA.dns.zone_entity);
IPA.register('dnsrecord', IPA.dns.record_entity);
+
+return {};
+});
diff --git a/install/ui/src/freeipa/entitle.js b/install/ui/src/freeipa/entitle.js
index ccf82173b..048577038 100644
--- a/install/ui/src/freeipa/entitle.js
+++ b/install/ui/src/freeipa/entitle.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Endi S. Dewata <edewata@redhat.com>
*
@@ -20,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
-
+define(['./ipa', './jquery', './details', './search', './add',
+ './facet', './entity', './field', './widget'], function(IPA, $) {
IPA.entitle = {};
@@ -743,3 +741,6 @@ IPA.entitle.download_widget = function(spec) {
};
IPA.register('entitle', IPA.entitle.entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/entity.js b/install/ui/src/freeipa/entity.js
index d474ad95b..08ba7e577 100644
--- a/install/ui/src/freeipa/entity.js
+++ b/install/ui/src/freeipa/entity.js
@@ -1,7 +1,3 @@
-/*jsl:import ipa.js */
-/*jsl:import facet.js */
-/*jsl:import navigation.js */
-
/* Authors:
* Pavel Zuna <pzuna@redhat.com>
* Endi Sukma Dewata <edewata@redhat.com>
@@ -25,7 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, facet.js, details.js, search.js, add.js */
+define(['./ipa', './jquery', './facet'], function(IPA, $) {
IPA.entity = function(spec) {
@@ -728,4 +724,7 @@ IPA.details_facet_update_policy = function(spec) {
spec.dest_facet = 'search';
return IPA.facet_update_policy(spec);
-}; \ No newline at end of file
+};
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js
index 25d48bf66..77e05cab6 100644
--- a/install/ui/src/freeipa/facet.js
+++ b/install/ui/src/freeipa/facet.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Pavel Zuna <pzuna@redhat.com>
* Endi Sukma Dewata <edewata@redhat.com>
@@ -23,7 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js */
+define(['./ipa', './jquery', './dialog', './field', './widget'], function(IPA, $) {
IPA.facet = function(spec, no_init) {
@@ -2041,4 +2039,7 @@ IPA.action_list_widget = function(spec) {
};
return that;
-}; \ No newline at end of file
+};
+
+return {};
+});
diff --git a/install/ui/src/freeipa/field.js b/install/ui/src/freeipa/field.js
index ff807dcfc..f6906d7d9 100644
--- a/install/ui/src/freeipa/field.js
+++ b/install/ui/src/freeipa/field.js
@@ -1,4 +1,3 @@
-/*jsl:import ipa.js */
/* Authors:
* Endi Sukma Dewata <edewata@redhat.com>
* Adam Young <ayoung@redhat.com>
@@ -22,7 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, widget.js */
+define(['./ipa', './jquery'], function(IPA, $) {
IPA.field = function(spec) {
spec = spec || {};
@@ -948,4 +947,7 @@ IPA.field_factories['select'] = IPA.select_field;
IPA.field_factories['sshkeys'] = IPA.sshkeys_field;
IPA.field_factories['textarea'] = IPA.field;
IPA.field_factories['text'] = IPA.field;
-IPA.field_factories['value_map'] = IPA.field; \ No newline at end of file
+IPA.field_factories['value_map'] = IPA.field;
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/group.js b/install/ui/src/freeipa/group.js
index 8317d679f..b7749a990 100644
--- a/install/ui/src/freeipa/group.js
+++ b/install/ui/src/freeipa/group.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Pavel Zuna <pzuna@redhat.com>
* Endi Dewata <edewata@redhat.com>
@@ -22,7 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.group = {};
@@ -257,3 +256,6 @@ IPA.group.make_external_action = function(spec) {
};
IPA.register('group', IPA.group.entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/hbac.js b/install/ui/src/freeipa/hbac.js
index 63c928aab..5bf844469 100644
--- a/install/ui/src/freeipa/hbac.js
+++ b/install/ui/src/freeipa/hbac.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Endi Sukma Dewata <edewata@redhat.com>
* Adam Young <ayoung@redhat.com>
@@ -21,7 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.hbac = {
//priority of commands in details facet
@@ -551,3 +550,6 @@ IPA.hbacrule_details_facet = function(spec) {
IPA.register('hbacrule', IPA.hbac.rule_entity);
IPA.register('hbacsvc', IPA.hbac.service_entity);
IPA.register('hbacsvcgroup', IPA.hbac.service_group_entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/hbactest.js b/install/ui/src/freeipa/hbactest.js
index 93d17c719..1fa88fca4 100644
--- a/install/ui/src/freeipa/hbactest.js
+++ b/install/ui/src/freeipa/hbactest.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Endi Sukma Dewata <edewata@redhat.com>
*
@@ -20,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js,hbac.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity', './hbac'], function(IPA, $) {
IPA.hbac.test_entity = function(spec) {
@@ -840,3 +839,6 @@ IPA.hbac.validation_dialog = function(spec) {
};
IPA.register('hbactest', IPA.hbac.test_entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/host.js b/install/ui/src/freeipa/host.js
index 30086b414..133c38ffd 100644
--- a/install/ui/src/freeipa/host.js
+++ b/install/ui/src/freeipa/host.js
@@ -1,6 +1,3 @@
-/*jsl:import ipa.js */
-/*jsl:import certificate.js */
-
/* Authors:
* Pavel Zuna <pzuna@redhat.com>
* Endi S. Dewata <edewata@redhat.com>
@@ -22,7 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity', './certificate'], function(IPA, $) {
IPA.host = {};
@@ -945,3 +943,6 @@ IPA.host.certificate_policy = function(spec) {
};
IPA.register('host', IPA.host.entity);
+
+return {};
+});
diff --git a/install/ui/src/freeipa/hostgroup.js b/install/ui/src/freeipa/hostgroup.js
index 20e7179fb..54531924d 100644
--- a/install/ui/src/freeipa/hostgroup.js
+++ b/install/ui/src/freeipa/hostgroup.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Pavel Zuna <pzuna@redhat.com>
*
@@ -20,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.hostgroup = {};
@@ -88,3 +87,6 @@ IPA.hostgroup.entity = function(spec) {
};
IPA.register('hostgroup', IPA.hostgroup.entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/idrange.js b/install/ui/src/freeipa/idrange.js
index b2ce3169f..847bc98ab 100644
--- a/install/ui/src/freeipa/idrange.js
+++ b/install/ui/src/freeipa/idrange.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Petr Vobornik <pvoborni@redhat.com>
*
@@ -20,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.idrange = {};
@@ -160,3 +159,6 @@ IPA.idrange.entity = function(spec) {
};
IPA.register('idrange', IPA.idrange.entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js
index c646d8c46..1619cad55 100644
--- a/install/ui/src/freeipa/ipa.js
+++ b/install/ui/src/freeipa/ipa.js
@@ -22,9 +22,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
-/* REQUIRES: jquery.ordered-map.js */
-/*global $:true, location:true */
+define(['./jquery', './json2'], function($, JSON) {
var IPA = function() {
@@ -2119,3 +2117,6 @@ IPA.config = {
message_fadeout_time: 800, // [ms]
message_fadein_time: 400 // [ms]
};
+
+return IPA;
+});
diff --git a/install/ui/src/freeipa/jquery.js b/install/ui/src/freeipa/jquery.js
new file mode 100644
index 000000000..da86e95d3
--- /dev/null
+++ b/install/ui/src/freeipa/jquery.js
@@ -0,0 +1,26 @@
+/* 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/>.
+*/
+
+//
+// AMD Wrapper for jquery library
+//
+define(function() {
+ return jQuery;
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/json2.js b/install/ui/src/freeipa/json2.js
new file mode 100644
index 000000000..dfc4773e0
--- /dev/null
+++ b/install/ui/src/freeipa/json2.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/>.
+*/
+
+//
+// AMD Wrapper for json2 library
+//
+
+define(function() {
+ return JSON;
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/navigation.js b/install/ui/src/freeipa/navigation.js
index deef37dd8..910fb79e2 100644
--- a/install/ui/src/freeipa/navigation.js
+++ b/install/ui/src/freeipa/navigation.js
@@ -21,6 +21,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+define(['./ipa', './jquery'], function(IPA, $) {
+
IPA.navigation = function(spec) {
spec = spec || {};
@@ -453,3 +455,6 @@ IPA.navigation = function(spec) {
return that;
};
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/net.js b/install/ui/src/freeipa/net.js
index b8674919f..11a245c0b 100644
--- a/install/ui/src/freeipa/net.js
+++ b/install/ui/src/freeipa/net.js
@@ -18,6 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+define(['./ipa', './jquery'], function(IPA, $) {
+
var NET = {};
NET.ip_address = function(spec) {
@@ -391,4 +393,7 @@ NET.ip_address = function(spec) {
that.parse();
return that;
-}; \ No newline at end of file
+};
+
+return NET;
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/netgroup.js b/install/ui/src/freeipa/netgroup.js
index 73deec100..05995e7bb 100644
--- a/install/ui/src/freeipa/netgroup.js
+++ b/install/ui/src/freeipa/netgroup.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Pavel Zuna <pzuna@redhat.com>
*
@@ -20,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.netgroup = {
remove_method_priority: IPA.config.default_priority - 1,
@@ -304,3 +303,6 @@ IPA.netgroup.details_facet = function(spec) {
};
IPA.register('netgroup', IPA.netgroup.entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/policy.js b/install/ui/src/freeipa/policy.js
index c109163e4..5161a4541 100644
--- a/install/ui/src/freeipa/policy.js
+++ b/install/ui/src/freeipa/policy.js
@@ -1,6 +1,3 @@
-/*jsl:import ipa.js */
-/*jsl:import search.js */
-
/* Authors:
* Adam Young <ayoung@redhat.com>
*
@@ -21,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.pwpolicy = {};
@@ -120,3 +118,6 @@ IPA.krbtpolicy.entity = function(spec) {
IPA.register('pwpolicy', IPA.pwpolicy.entity);
IPA.register('krbtpolicy', IPA.krbtpolicy.entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/rule.js b/install/ui/src/freeipa/rule.js
index dfe710b91..888fd4508 100644
--- a/install/ui/src/freeipa/rule.js
+++ b/install/ui/src/freeipa/rule.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Endi Sukma Dewata <edewata@redhat.com>
*
@@ -20,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.rule_details_widget = function(spec) {
@@ -252,3 +251,6 @@ IPA.rule_association_adder_dialog = function(spec) {
return that;
};
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/search.js b/install/ui/src/freeipa/search.js
index b54c375f7..a3f35b5e9 100644
--- a/install/ui/src/freeipa/search.js
+++ b/install/ui/src/freeipa/search.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Pavel Zuna <pzuna@redhat.com>
* Adam Young <ayoung@redhat.com>
@@ -23,7 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js */
+define(['./ipa', './jquery', './facet'], function(IPA, $) {
IPA.search_facet = function(spec, no_init) {
@@ -488,4 +486,7 @@ IPA.batch_enable_action = function(spec) {
spec.confirm_msg = spec.confirm_msg || IPA.messages.search.enable_confirm;
return IPA.batch_items_action(spec);
-}; \ No newline at end of file
+};
+
+return {};
+});
diff --git a/install/ui/src/freeipa/selinux.js b/install/ui/src/freeipa/selinux.js
index ca4700609..d8e0d3ead 100644
--- a/install/ui/src/freeipa/selinux.js
+++ b/install/ui/src/freeipa/selinux.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Petr Vobornik <pvoborni@redhat.com>
*
@@ -20,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.selinux = {
remove_method_priority: IPA.config.default_priority - 1
@@ -312,4 +311,7 @@ IPA.selinux_details_facet = function(spec) {
return that;
};
-IPA.register('selinuxusermap', IPA.selinux.selinuxusermap_entity); \ No newline at end of file
+IPA.register('selinuxusermap', IPA.selinux.selinuxusermap_entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/serverconfig.js b/install/ui/src/freeipa/serverconfig.js
index 517aa7800..347c46c1c 100644
--- a/install/ui/src/freeipa/serverconfig.js
+++ b/install/ui/src/freeipa/serverconfig.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Endi Sukma Dewata <edewata@redhat.com>
* Adam Young <ayoung@redhat.com>
@@ -21,7 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.serverconfig = {};
@@ -116,3 +115,6 @@ IPA.serverconfig.entity = function(spec) {
};
IPA.register('config', IPA.serverconfig.entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/service.js b/install/ui/src/freeipa/service.js
index 04e294bf0..ecb8ce9b3 100644
--- a/install/ui/src/freeipa/service.js
+++ b/install/ui/src/freeipa/service.js
@@ -1,6 +1,3 @@
-/*jsl:import ipa.js */
-/*jsl:import certificate.js */
-
/* Authors:
* Endi Sukma Dewata <edewata@redhat.com>
*
@@ -21,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.service = {};
@@ -465,3 +463,6 @@ IPA.service.certificate_policy = function(spec) {
};
IPA.register('service', IPA.service.entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/sudo.js b/install/ui/src/freeipa/sudo.js
index fddcda0b5..b13b7ac77 100644
--- a/install/ui/src/freeipa/sudo.js
+++ b/install/ui/src/freeipa/sudo.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Endi Sukma Dewata <edewata@redhat.com>
*
@@ -20,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.sudo = {
//priority of commands in details facet
@@ -928,3 +927,6 @@ IPA.sudo.options_section = function(spec) {
IPA.register('sudorule', IPA.sudo.rule_entity);
IPA.register('sudocmd', IPA.sudo.command_entity);
IPA.register('sudocmdgroup', IPA.sudo.command_group_entity);
+
+return {};
+});
diff --git a/install/ui/src/freeipa/trust.js b/install/ui/src/freeipa/trust.js
index 939bb59a3..22880bfe7 100644
--- a/install/ui/src/freeipa/trust.js
+++ b/install/ui/src/freeipa/trust.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Petr Vobornik <pvoborni@redhat.com>
*
@@ -20,7 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity'], function(IPA, $) {
IPA.trust = {};
@@ -181,3 +180,6 @@ IPA.trust.adder_dialog = function(spec) {
};
IPA.register('trust', IPA.trust.entity);
+
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/user.js b/install/ui/src/freeipa/user.js
index ac51db2ba..a7beca18f 100644
--- a/install/ui/src/freeipa/user.js
+++ b/install/ui/src/freeipa/user.js
@@ -1,5 +1,3 @@
-/*jsl:import ipa.js */
-
/* Authors:
* Pavel Zuna <pzuna@redhat.com>
* Adam Young <ayoung@redhat.com>
@@ -23,7 +21,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
+define(['./ipa', './jquery', './details', './search', './association',
+ './entity', './certificate'], function(IPA, $) {
IPA.user = {};
@@ -660,4 +659,7 @@ IPA.user.reset_password_acl_evaluator = function(spec) {
return that;
};
-IPA.register('user', IPA.user.entity); \ No newline at end of file
+IPA.register('user', IPA.user.entity);
+
+return {};
+});
diff --git a/install/ui/src/freeipa/webui.js b/install/ui/src/freeipa/webui.js
index f381ab0be..f6c3339ec 100644
--- a/install/ui/src/freeipa/webui.js
+++ b/install/ui/src/freeipa/webui.js
@@ -1,6 +1,3 @@
-/*jsl:import ipa.js */
-/*jsl:import navigation.js */
-
/* Authors:
* Pavel Zuna <pzuna@redhat.com>
* Endi S. Dewata <edewata@redhat.com>
@@ -22,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: everything, this file puts it all togheter */
+define(['./ipa'], function(IPA) {
/* tabs definition for IPA webUI */
@@ -128,77 +125,5 @@ IPA.self_serv_navigation = function(spec) {
return that;
};
-/* main (document onready event handler) */
-$(function() {
-
-
-
- /* main loop (hashchange event handler) */
- function window_hashchange(evt){
- IPA.nav.update();
- }
-
- function create_navigation() {
- var whoami = IPA.whoami;
- var factory;
-
-
- if (whoami.hasOwnProperty('memberof_group') &&
- whoami.memberof_group.indexOf('admins') !== -1) {
- factory = IPA.admin_navigation;
- } else if (whoami.hasOwnProperty('memberofindirect_group')&&
- whoami.memberofindirect_group.indexOf('admins') !== -1) {
- factory = IPA.admin_navigation;
- } else if (whoami.hasOwnProperty('memberof_role') &&
- whoami.memberof_role.length > 0) {
- factory = IPA.admin_navigation;
- } else if (whoami.hasOwnProperty('memberofindirect_role') &&
- whoami.memberofindirect_role.length > 0) {
- factory = IPA.admin_navigation;
- } else {
- factory = IPA.self_serv_navigation;
- }
-
- return factory({
- container: $('#navigation'),
- content: $('#content')
- });
- }
-
-
- function init_on_success(data, text_status, xhr) {
- $(window).bind('hashchange', window_hashchange);
-
- var whoami = IPA.whoami;
- IPA.whoami_pkey = whoami.uid[0];
- $('#loggedinas .login').text(whoami.cn[0]);
- $('#loggedinas a').fragment(
- {'user-facet': 'details', 'user-pkey': IPA.whoami_pkey}, 2);
-
- $('#logout').click(function() {
- IPA.logout();
- return false;
- }).text(IPA.messages.login.logout);
-
- $('.header-loggedinas').css('visibility','visible');
- IPA.update_password_expiration();
-
- IPA.nav = create_navigation();
- IPA.nav.create();
- IPA.nav.update();
-
- $('#login_header').html(IPA.messages.login.header);
- }
-
-
- function init_on_error(xhr, text_status, error_thrown) {
- var container = $('#content').empty();
- container.append('<p>Error: '+error_thrown.name+'</p>');
- container.append('<p>'+error_thrown.message+'</p>');
- }
-
- IPA.init({
- on_success: init_on_success,
- on_error: init_on_error
- });
-});
+return {};
+}); \ No newline at end of file
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 8d2239d89..dc39c7ecd 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -21,7 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* REQUIRES: ipa.js */
+define(['./ipa', './jquery'], function(IPA, $) {
IPA.checkbox_column_width = 22;
IPA.required_indicator = '*';
@@ -3556,4 +3556,7 @@ IPA.widget_factories['select'] = IPA.select_widget;
IPA.widget_factories['sshkeys'] = IPA.sshkeys_widget;
IPA.widget_factories['textarea'] = IPA.textarea_widget;
IPA.widget_factories['text'] = IPA.text_widget;
-IPA.widget_factories['value_map'] = IPA.value_map_widget; \ No newline at end of file
+IPA.widget_factories['value_map'] = IPA.value_map_widget;
+
+return {};
+});