From: Michael M Slusarz Date: Mon, 9 Feb 2009 21:44:17 +0000 (-0700) Subject: Update acl javascript X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=99166d1c5db74eafa1cb17d722a2797ee1187664;p=horde.git Update acl javascript --- diff --git a/imp/acl.php b/imp/acl.php index c71854d52..f063498a1 100644 --- a/imp/acl.php +++ b/imp/acl.php @@ -137,7 +137,7 @@ $t->setOption('gettext', true); $t->set('aclurl', Horde::applicationUrl('acl.php')); $t->set('forminput', Util::formInput()); $t->set('aclnavcell', Util::bufferOutput(array('Prefs_UI', 'generateNavigationCell'), 'acl')); -$t->set('changefolder', Horde::link('#', _("Change Folder"), 'smallheader', '', 'ACLFolderChange(true); return false;')); +$t->set('changefolder', Horde::link('#', _("Change Folder"), 'smallheader', '', '', '', '', array('id' => 'changefolder'))); $t->set('sharedimg', Horde::img('shared.png', _("Change Folder"))); $t->set('options', IMP::flistSelect(array('selected' => $folder))); $t->set('current', sprintf(_("Current access to %s"), IMP::displayFolder($folder))); diff --git a/imp/js/acl.js b/imp/js/acl.js index 67c44bfa4..af0f1a7ee 100644 --- a/imp/js/acl.js +++ b/imp/js/acl.js @@ -1 +1 @@ -var acl_loading;function ACLFolderChange(a){if($F("aclfolder")){if(acl_loading==null||a!=null){acl_loading=true;$("acl").disable();$("folders").submit()}}}; \ No newline at end of file +var ImpAcl={acl_loading:false,folderChange:function(b,a){if($F("aclfolder")){if(!this.acl_loading||a!=null){this.acl_loading=true;$("acl").disable();$("folders").submit();b.stop()}}},changeHandler:function(a){switch(a.element().readAttribute("id")){case"aclfolder":this.folderChange(a);break}},clickHandler:function(a){switch(a.element().readAttribute("id")){case"changefolder":case"resetbut":this.folderChange(a,true);break}}};document.observe("change",ImpAcl.changeHandler.bindAsEventListener(ImpAcl));document.observe("click",ImpAcl.clickHandler.bindAsEventListener(ImpAcl)); \ No newline at end of file diff --git a/imp/js/src/acl.js b/imp/js/src/acl.js index e33bc2089..62bcfd16e 100644 --- a/imp/js/src/acl.js +++ b/imp/js/src/acl.js @@ -1,19 +1,46 @@ /** - * Provides the javascript for the acl.php script + * Provides the javascript for the acl.php script (standard view). * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. */ -var acl_loading; +var ImpAcl = { -function ACLFolderChange(clear) -{ - if ($F('aclfolder')) { - if (acl_loading == null || clear != null) { - acl_loading = true; - $('acl').disable(); - $('folders').submit(); + acl_loading: false, + + folderChange: function(e, clear) + { + if ($F('aclfolder')) { + if (!this.acl_loading || clear != null) { + this.acl_loading = true; + $('acl').disable(); + $('folders').submit(); + e.stop(); + } + } + }, + + changeHandler: function(e) + { + switch (e.element().readAttribute('id')) { + case 'aclfolder': + this.folderChange(e); + break; + } + }, + + clickHandler: function(e) + { + switch (e.element().readAttribute('id')) { + case 'changefolder': + case 'resetbut': + this.folderChange(e, true); + break; } } -} + +}; + +document.observe('change', ImpAcl.changeHandler.bindAsEventListener(ImpAcl)); +document.observe('click', ImpAcl.clickHandler.bindAsEventListener(ImpAcl)); diff --git a/imp/templates/acl/acl.html b/imp/templates/acl/acl.html index 79580aad9..fcbae3331 100644 --- a/imp/templates/acl/acl.html +++ b/imp/templates/acl/acl.html @@ -11,7 +11,7 @@ @@ -77,7 +77,7 @@ - +