Index: customfieldadmin/htdocs/js/CustomFieldAdminPage_actions.js
===================================================================
--- customfieldadmin/htdocs/js/CustomFieldAdminPage_actions.js	(revision 5022)
+++ customfieldadmin/htdocs/js/CustomFieldAdminPage_actions.js	(working copy)
@@ -1,75 +0,0 @@
-/**********
-* User Interface function for Trac Custom Field Admin plugin.
-* License: BSD
-* (c) 2007      ::: www.Optaros.com (.....)
-**********/
-
-/**
-* 
-*/
-function addcfType_validate( ){
-    function getLabel( id ){
-        var labelElements = document.getElementById('addcf').getElementsByTagName("LABEL");
-        
-        for( var i=0; i<labelElements.length; i++)  {
-            if( labelElements[i].getAttribute("for") ==id )
-                return labelElements[i];
-        }
-        
-        return false;
-    }
-    
-    function show( id ){
-        try{
-            document.getElementById( id ).style.display="block";
-            if( label = getLabel(id))label.style.display="block";
-        }catch(Err){}
-    }
-    
-    function hide( id ){
-        try{        
-            document.getElementById( id ).style.display="none";
-            if( label = getLabel(id))label.style.display="none";
-        }catch(Err){}
-    }
-            
-    switch(document.getElementById('type').selectedIndex){
-        case 0:            
-            hide('options');
-            hide('cols');
-            hide('rows');           
-            break;
-        case 1:
-            show('options');
-            hide('cols');
-            hide('rows');               
-            break;
-        case 2:
-            hide('options');
-            hide('cols');
-            hide('rows');               
-            break;
-        case 3:
-            show('options');
-            hide('cols');
-            hide('rows');               
-            break;
-        case 4:
-            hide('options');
-            show('cols');
-            show('rows');               
-            break;
-    }
-        
-}
-
-/**
-*
-*/
-addEvent(window,'load',function(){
-    addcfType_validate();
-    
-    addEvent(document.getElementById('type'),'change',function(){
-        addcfType_validate( );      
-    });
-});
Index: customfieldadmin/htdocs/js/customfieldadmin.js
===================================================================
--- customfieldadmin/htdocs/js/customfieldadmin.js	(revision 0)
+++ customfieldadmin/htdocs/js/customfieldadmin.js	(revision 0)
@@ -0,0 +1,34 @@
+/**********
+* User Interface function for Trac Custom Field Admin plugin.
+* License: BSD
+* (c) 2007      ::: www.Optaros.com (cbalan@optaros.com)
+**********/
+;(function($){
+    function toggle_options(type_element){
+        function label(property){ return $(property).parents('div.field')}
+        switch (type_element.selectedIndex) {
+            case 0: // text
+                label('#options, #cols, #rows').hide();
+                break;
+            case 1: // select
+            case 2: // checkbox
+            case 3: // radio
+                label('#options').show();
+                label('#cols, #rows').hide();
+                break;      
+            case 4: // textarea
+                label('#options').hide();
+                label('#cols, #rows').show();
+                break;
+        }
+    }
+    
+    $(document).ready(function(){
+        $('#type').each(function(){
+            toggle_options(this);
+            $(this).change(function(){
+                toggle_options(this);
+            });
+        });
+    });
+})(jQuery);

Property changes on: customfieldadmin/htdocs/js/customfieldadmin.js
___________________________________________________________________
Added: svn:executable
   + *

Index: customfieldadmin/customfieldadmin.py
===================================================================
--- customfieldadmin/customfieldadmin.py	(revision 5022)
+++ customfieldadmin/customfieldadmin.py	(working copy)
@@ -28,7 +28,7 @@
     def render_admin_panel(self, req, cat, page, customfield):
         req.perm.require('TICKET_ADMIN')
         
-        add_script(req, 'customfieldadmin/js/CustomFieldAdminPage_actions.js')
+        add_script(req, 'customfieldadmin/js/customfieldadmin.js')
 
         def _customfield_from_req(self, req):
             cfdict = {'name': to_unicode(req.args.get('name')),
