From: Michael M Slusarz Date: Fri, 6 Aug 2010 19:48:16 +0000 (-0600) Subject: Move logintasks javascript out of template file X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c6661fe1adbd8804dbb41acae0066920520dd82e;p=horde.git Move logintasks javascript out of template file --- diff --git a/horde/js/logintasks.js b/horde/js/logintasks.js new file mode 100644 index 000000000..f99a0d235 --- /dev/null +++ b/horde/js/logintasks.js @@ -0,0 +1,19 @@ +/** + * Provides the javascript for the logintasks confirmation page. + * + * See the enclosed file COPYING for license information (LGPL). If you + * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. + */ + +document.observe('click', function(e) { + switch (e.element().readAttribute('id')) { + case 'logintasks_skip': + $('logintasks_confirm').getInputs('checkbox').invoke('setValue', 0); + $('logintasks_confirm').submit(); + break; + } +}); + +document.observe('dom:loaded', function() { + $('logintasks_skip').show(); +}); diff --git a/horde/services/logintasks.php b/horde/services/logintasks.php index 595dbcc27..092950a9f 100644 --- a/horde/services/logintasks.php +++ b/horde/services/logintasks.php @@ -30,7 +30,6 @@ $tasks->runTasks(Horde_Util::getPost('logintasks_page')); /* Create the Horde_Template item. */ $template = $injector->createInstance('Horde_Template'); -$template->set('javascript', $browser->hasFeature('javascript'), true); /* Have the maintenance module do all necessary processing. */ $tasklist = $tasks->displayTasks(); @@ -86,6 +85,8 @@ Horde::startBuffer(); $notification->notify(array('listeners' => 'status')); $template->set('notify', Horde::endBuffer()); +Horde::addScriptFile('logintasks.js', 'horde'); + $bodyId = 'services_logintasks'; require HORDE_TEMPLATES . '/common-header.inc'; echo $template->fetch(HORDE_TEMPLATES . '/logintasks/logintasks.html'); diff --git a/horde/templates/logintasks/logintasks.html b/horde/templates/logintasks/logintasks.html index 0360a25f9..03a287419 100644 --- a/horde/templates/logintasks/logintasks.html +++ b/horde/templates/logintasks/logintasks.html @@ -1,22 +1,9 @@ -
+ - - - - @@ -41,9 +28,7 @@ function uncheckAll()
- - - +