diff options
author | Adam Young <ayoung@redhat.com> | 2010-11-17 22:15:09 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2010-11-18 20:02:45 -0500 |
commit | 775fc23738d8a882bdd9cff9064b50594901e518 (patch) | |
tree | 35f841fa75bae9f4aef72ce80791aa49e2e62053 /install/static/webui.js | |
parent | 5da8313b668340494f06afe6d3459f368948588f (diff) | |
download | freeipa.git-775fc23738d8a882bdd9cff9064b50594901e518.tar.gz freeipa.git-775fc23738d8a882bdd9cff9064b50594901e518.tar.xz freeipa.git-775fc23738d8a882bdd9cff9064b50594901e518.zip |
batch init this batches together the calls to json_metadata, i18n_messages, and user-find [whoami] tostreamline the init process, and also allow us to add a call to enumerate the plugins.
Diffstat (limited to 'install/static/webui.js')
-rw-r--r-- | install/static/webui.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/install/static/webui.js b/install/static/webui.js index bf367ee9..b588876a 100644 --- a/install/static/webui.js +++ b/install/static/webui.js @@ -53,20 +53,20 @@ var self_serv_tab_set = {name:'user', label:'Users', setup:ipa_entity_setup}]}]; -var ipa_whoami_pkey; /* main (document onready event handler) */ $(function() { - function whoami_on_win(data, text_status, xhr) { + + function init_on_win(data, text_status, xhr) { $(window).bind('hashchange', window_hashchange); - var whoami = data.result.result[0]; - ipa_whoami_pkey=whoami.uid[0]; + var whoami = IPA.whoami; + IPA.whoami_pkey=whoami.uid[0]; $('#loggedinas').find('strong').text(whoami.krbprincipalname[0]); $('#loggedinas a').fragment( - {'user-facet':'details', 'user-pkey':ipa_whoami_pkey},2); + {'user-facet':'details', 'user-pkey':IPA.whoami_pkey},2); for (var i=0; i<IPA.entities.length; i++) { var entity = IPA.entities[i]; @@ -82,7 +82,7 @@ $(function() { } else { nav_create(self_serv_tab_set, navigation, 'tabs'); - var state = {'user-pkey':ipa_whoami_pkey , + var state = {'user-pkey':IPA.whoami_pkey , 'user-facet': jQuery.bbq.getState('user-facet') || 'details'}; $.bbq.pushState(state); @@ -92,9 +92,6 @@ $(function() { $('#login_header').html(IPA.messages.login.header); } - function init_on_win(data, text_status, xhr) { - ipa_cmd('user_find', [], {"whoami":"true","all":"true"}, whoami_on_win, init_on_error, null); - } function init_on_error(xhr, text_status, error_thrown) { var navigation = $('#navigation').empty(); |