| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 | 
							- // $Id$
 
- /**
 
-  * @file
 
-  * Munin API for Drupal: settings UI eye candy
 
-  *
 
-  * @author Frederic G. MARAND
 
-  *
 
-  * @copyright (c) 2011 Ouest Systèmes Informatiques
 
-  *
 
-  * Licensed under the General Public License version 2 or later.
 
-  */
 
- /*jslint white: true, onevar: true, undef: true, nomen: true, eqeqeq: true,
 
-   plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true,
 
-   indent: 2 */
 
- /*global Drupal,$ */
 
- /**
 
-  * Fade a selection in or out, depending on the parameters
 
-  *
 
-  * @param string selector
 
-  *   A jQuery selector
 
-  * @param boolean visible
 
-  *   Set to true to fade in, to fase to fade out
 
-  * @return void
 
-  */
 
- function muninApiFade(selector, visible) {
 
-   if (visible) {
 
-     $(selector).fadeIn();
 
-   }
 
-   else {
 
-     $(selector).fadeOut();
 
-   }
 
- }
 
- /**
 
-  * Ready handler to apply visibility to the path field on the settings form.
 
-  *
 
-  * Hide the manual path selector initially unless the current watchdog mode is
 
-  * set to init.
 
-  *
 
-  * @return void
 
-  */
 
- function onReadyPathVisibility() {
 
-   if ($('#edit-munin-api-watchdog-init').attr('checked') === false) {
 
-     $('#edit-munin-api-init-path-wrapper').hide();
 
-   }
 
-   $("input:radio[name='munin_api_watchdog']").click(function () {
 
-     muninApiFade('#edit-munin-api-init-path-wrapper',
 
-       $("input:radio[name='munin_api_watchdog']:checked").val() === 'init');
 
-   });
 
- }
 
- /**
 
-  * Assign ready handler
 
-  */
 
- $(function () {
 
-   onReadyPathVisibility();
 
- });
 
 
  |