o: ActiveSupport::Cache::Entry :@expires_in0:@compressedF:@value"á"{"content_type"application/javascript" class"ProcessedAsset"dependency_digest"%38fc22f2b5a02d2dfa32b608d06ef264" mtime"2012-04-28T20:21:50-05:00" _version"%9f3b95dd7ea3030dc35985c0a8020862"dependency_paths[{" mtime"2012-04-28T20:21:50-05:00"digest"%42541491b437db80c2d82cca1fd52025" path"W/Users/njones/Code/rails_admin/app/assets/javascripts/rails_admin/ra.filter-box.js"digest"%42541491b437db80c2d82cca1fd52025"required_paths["W/Users/njones/Code/rails_admin/app/assets/javascripts/rails_admin/ra.filter-box.js" pathname"W/Users/njones/Code/rails_admin/app/assets/javascripts/rails_admin/ra.filter-box.js"logical_path"!rails_admin/ra.filter-box.js"lengthi/ "source"/ (function($) { var filters; $.filters = filters = { options: { regional: { datePicker: { dateFormat: 'mm/dd/yy' } } }, append: function(field_label, field_name, field_type, field_value, field_operator, field_options, index) { var value_name = 'f[' + field_name + '][' + index + '][v]'; var operator_name = 'f[' + field_name + '][' + index + '][o]'; switch(field_type) { case 'boolean': var control = ''; break; case 'date': case 'datetime': case 'timestamp': var control = '' var additional_control = ' ' + ' ' + ''; break; case 'enum': var multiple_values = ((field_value instanceof Array) ? true : false) var control = '' + ' ' + ''; break; case 'string': case 'text': case 'belongs_to_association': var control = '' var additional_control = ' '; break; default: var control = ' '; break; } var content = '
' + ' ' + field_label + ' ' + control + " " + (additional_control || '') + ' '; $('#filters_box').append(content); $('#filters_box .date').datepicker(this.options.regional.datePicker); $("hr.filters_box:hidden").show('slow'); } } $("#filters a").live('click', function(e) { e.preventDefault(); $.filters.append( $(this).data('field-label'), $(this).data('field-name'), $(this).data('field-type'), $(this).data('field-value'), $(this).data('field-operator'), $(this).data('field-options'), $.now().toString().slice(6,11) ); }); $('#filters_box .delete').live('click', function(e) { e.preventDefault(); form = $(this).parents('form'); $(this).parents('.filter').remove(); !$("#filters_box").children().length && $("hr.filters_box:visible").hide('slow'); }); $('#filters_box .switch-select').live('click', function(e) { e.preventDefault(); var selected_select = $(this).siblings('select:visible'); var not_selected_select = $(this).siblings('select:hidden'); not_selected_select.attr('name', not_selected_select.data('name')).show('slow'); selected_select.attr('name', null).hide('slow'); $(this).find('i').toggleClass("icon-plus icon-minus") }); $('#filters_box .switch-additionnal-fieldsets').live('change', function() { var selected_option = $(this).find('option:selected'); if(klass = $(selected_option).data('additional-fieldset')) { $(this).siblings('.additional-fieldset:not(.' + klass + ')').hide('slow'); $(this).siblings('.' + klass).show('slow'); } else { $(this).siblings('.additional-fieldset').hide('slow'); } }); })( jQuery ); :@created_atf1335716315.7216959 0D