I had to use pngfix in quite a few classes but I found the textfield wasn't allowing me to add extra classes, I've attached a patch which increases the maxlength property of the textfield

CommentFileSizeAuthor
pngfix.admin_.inc_.patch1005 bytesvivianspencer

Comments

Cool_Goose’s picture

Would it be that bad if it would be a textarea ?
something like:

function pngfix_admin() {
  $form = array();
  $form['pngfix_css_classes'] = array(
    '#type' => 'textarea',
    '#title' => t('CSS Classes'),
    '#default_value' => variable_get('pngfix_css_classes', ''),
    '#description' => t('Comma seperated list of CSS classes to apply the PNG Fix to (use <a href="@jqueryselector">jQuery Selectors</a>).  The CSS class must be for the element that surrounds the image, and not for the image itself.  In the case of &amp;lt;div class=&quot;pngfix&quot;&amp;gt;&amp;lt;img ... /&amp;gt;&amp;lt;/div&amp;gt;, use .pngfix to apply the PNG Fix to the image.', array('@jqueryselector' => 'http://docs.jquery.com/Selectors')),
  );
  return system_settings_form($form);
} // function pngfix_admin
function pngfix_init() {
  $pngfixclasses = variable_get('pngfix_css_classes', '');
  if (!empty($pngfixclasses)) {
    $jquerypngfixjs = drupal_get_path('module', 'pngfix') .'/jquery.pngFix.js';
    drupal_add_js($jquerypngfixjs, 'module');
    $png_fix_classes_raw = explode(',' $pngfixclasses); // let's remake the string in case of line breaks
    $png_fix_classes_data = '';
    foreach ($png_fix_classes_raw as $png_fix_class) {
      $png_fix_classes_data .= $png_fix_class . ', ';
    }
    $png_fix_classes_data = substr($png_fix_classes_data, 0, -2); // to remove the last ", "
    $js = "$(document).ready(function(){ $('$png_fix_classes_data').pngFix(); });";
    drupal_add_js($js, 'inline');
  }
} // function pngfix_init

It's now quite tested and i suck at making patches. What do you think ?