[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/js/ -> form_sections.js (source)

   1  /**
   2   * Horde Form Sections Javascript Class
   3   *
   4   * Provides the javascript class for handling tabbed sections in Horde Forms.
   5   *
   6   * Copyright 2003-2006 Marko Djukic <marko@oblo.com>
   7   *
   8   * See the enclosed file COPYING for license information (LGPL). If you did not
   9   * receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  10   *
  11   * $Horde: horde/js/form_sections.js,v 1.1.2.2 2006/04/15 22:23:36 chuck Exp $
  12   *
  13   * @author  Marko Djukic <marko@oblo.com>
  14   * @package Horde_Form
  15   */
  16  function Horde_Form_Sections(instanceName, openSection)
  17  {
  18      /* Set up this class instance for function calls from the page. */
  19      this._instanceName = instanceName;
  20  
  21      /* The currently showed section. */
  22      var _openSection;
  23  
  24      this.toggle = function(sectionId)
  25      {
  26          /* Get the currently open section object. */
  27          openSectionId = this._get();
  28          if (document.getElementById('_section_' + openSectionId)) {
  29              document.getElementById('_section_' + openSectionId).style.display = 'none';
  30          }
  31          document.getElementById('_tab_' + openSectionId).className = null;
  32  
  33          /* Get the newly opened section object. */
  34          if (document.getElementById('_section_' + sectionId)) {
  35              document.getElementById('_section_' + sectionId).style.display = 'block';
  36          }
  37          document.getElementById('_tab_' + sectionId).className = 'activeTab';
  38  
  39          /* Store the newly opened section. */
  40          this._set(sectionId);
  41      }
  42  
  43      this._get = function()
  44      {
  45          return this._openSection;
  46      }
  47  
  48      this._set = function(sectionId)
  49      {
  50          var form = eval('document.' + this._instanceName);
  51          if (form != null &&
  52              typeof form.__formOpenSection != 'undefined') {
  53              form.__formOpenSection.value = escape(sectionId);
  54          }
  55          this._openSection = sectionId;
  56      }
  57  
  58      this._set(openSection);
  59  }


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7