Development

Changeset 7141

You must first sign up to be able to contribute.

Changeset 7141

Show
Ignore:
Timestamp:
01/22/08 07:25:27 (7 months ago)
Author:
davedash
Message:

ddAccessibleFormPlugin: Added YUI support.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/ddAccessibleFormPlugin/README

    r6993 r7141  
    2525}}} 
    2626 
    27 == jQuery == 
     27== Javascript == 
    2828 
    2929The `cmxform.js` forces `label` tags to use the `inline-box` display style.   
     
    3232`SF_JQUERY_WEB_DIR` setting. 
    3333 
    34 It's not recommended to mix multiple libraries.  If you use YUI, moo tools or  
     34Alternately you may use the Yahoo User Interface library.  For this to work, 
     35set `SF_JS_LIB` to `yui` and set `SF_YUI_WEB_DIR` to the proper location. 
     36If you are using hosted YUI, you can have a setting like so in your  
     37`settings.yml`: 
     38 
     39{{{ 
     40    yui_web_dir:            http://yui.yahooapis.com/2.4.1/build/ 
     41}}} 
     42 
     43It's not recommended to mix multiple libraries.  If you use dojo, moo tools or  
    3544prototype, it might be wise to create an alternate `cmxform.js` for your  
    3645platform.  If you create such a package please let the maintainer (Dave Dash) 
     
    4655 
    47562008-01-07  Updated README 
     572008-01-21  Added YUI support, cleaned up jQuery code. 
    4858 
    4959== Todo == 
    5060 
    51 * Impliment in YUI 
    5261* Impliment in moo tools 
    5362* Impliment in Prototype 
    5463* Create PEAR package 
     64* Impliment in dojo 
  • plugins/ddAccessibleFormPlugin/lib/helper/AccessibleFormHelper.php

    r6979 r7141  
    33{ 
    44  $response = sfContext::getInstance()->getResponse(); 
    5   $response->addJavascript(sfConfig::get('sf_jquery_web_dir', '/ddAccessibleFormPlugin').'/js/jquery'); 
    6   $response->addJavascript('/ddAccessibleFormPlugin/js/cmxform'); 
     5  if (sfConfig::get('sf_js_lib') == 'yui') 
     6  { 
     7    // we need to add the appropriate libs... 
     8    $response->addJavascript(sfConfig::get('sf_yui_web_dir').'yahoo/yahoo-min.js'); 
     9    $response->addJavascript(sfConfig::get('sf_yui_web_dir').'selector/selector-beta-min.js'); 
     10    $response->addJavascript(sfConfig::get('sf_yui_web_dir').'dom/dom-min.js'); 
     11     
     12    $response->addJavascript('/ddAccessibleFormPlugin/js/yui.cmxform.js');     
     13  } 
     14  else 
     15  { 
     16    $response->addJavascript(sfConfig::get('sf_jquery_web_dir', '/ddAccessibleFormPlugin').'/js/jquery'); 
     17    $response->addJavascript('/ddAccessibleFormPlugin/js/cmxform'); 
     18  } 
    719  $response->addStylesheet('/ddAccessibleFormPlugin/css/accessible_form'); 
    820 
  • plugins/ddAccessibleFormPlugin/web/js/cmxform.js

    r4100 r7141  
    1 var $j = jQuery.noConflict(); 
    21 
    32if(document.addEventListener) 
     
    65function cmxform() 
    76{ 
     7  var $j = jQuery.noConflict(); 
    88  // Hide forms 
    99  $j('form.cmxform').hide().end(); 
    1010 
    1111  // Processing 
    12   $j('form.cmxform').find('li/label').not('.nocmx').each( function(i)  
     12  $j('form.cmxform').find('li>label').not('.nocmx').each( function(i)  
    1313  { 
    1414    var labelContent        = this.innerHTML;