{I"
class:EFI"ProcessedAsset; FI"logical_path; FI"rails_admin/ra.widgets.js; TI"
pathname; FI"f/Users/sferik/Projects/Ruby/gems/rails_admin/app/assets/javascripts/rails_admin/ra.widgets.coffee; TI"content_type; FI"application/javascript; FI"
mtime; Fl+ÇØÌQI"length; FiÛ&I"digest; F"%d5bb2fb03161e28e8cd944a77b9fada2I"source; FI"Û&(function() {
$(document).on('rails_admin.dom_ready', function(e, content) {
var $editors, array, config_options, goBootstrapWysihtml5s, goCkeditors, goCodeMirrors, options,
_this = this;
content = content ? content : $('form');
if (content.length) {
content.find('[data-color]').each(function() {
var that;
that = this;
return $(this).ColorPicker({
color: $(that).val(),
onShow: function(el) {
$(el).fadeIn(500);
return false;
},
onHide: function(el) {
$(el).fadeOut(500);
return false;
},
onChange: function(hsb, hex, rgb) {
$(that).val(hex);
return $(that).css('backgroundColor', '#' + hex);
}
});
});
content.find('[data-datetimepicker]').each(function() {
return $(this).datetimepicker($(this).data('options'));
});
content.find('[data-enumeration]').each(function() {
if ($(this).is('[multiple]')) {
return $(this).filteringMultiselect($(this).data('options'));
} else {
return $(this).filteringSelect($(this).data('options'));
}
});
content.find('[data-fileupload]').each(function() {
var input;
input = this;
return $(this).on('click', ".delete input[type='checkbox']", function() {
return $(input).children('.toggle').toggle('slow');
});
});
content.find('[data-fileupload]').change(function() {
var ext, image_container, input, reader;
input = this;
image_container = $("#" + input.id).parent().children(".preview");
if (!image_container.length) {
image_container = $("#" + input.id).parent().prepend($('').addClass('preview')).find('img.preview');
image_container.parent().find('img:not(.preview)').hide();
}
ext = $("#" + input.id).val().split('.').pop().toLowerCase();
if (input.files && input.files[0] && $.inArray(ext, ['gif', 'png', 'jpg', 'jpeg', 'bmp']) !== -1) {
reader = new FileReader();
reader.onload = function(e) {
return image_container.attr("src", e.target.result);
};
reader.readAsDataURL(input.files[0]);
return image_container.show();
} else {
return image_container.hide();
}
});
content.find('[data-filteringmultiselect]').each(function() {
$(this).filteringMultiselect($(this).data('options'));
if ($(this).parents("#modal").length) {
return $(this).parents('.control-group').find('.btn').remove();
} else {
return $(this).parents('.control-group').first().remoteForm();
}
});
content.find('[data-filteringselect]').each(function() {
$(this).filteringSelect($(this).data('options'));
if ($(this).parents("#modal").length) {
return $(this).parents('.control-group').find('.btn').remove();
} else {
return $(this).parents('.control-group').first().remoteForm();
}
});
content.find('[data-nestedmany]').each(function() {
var field, nav, tab_content, toggler;
field = $(this).parents('.control-group').first();
nav = field.find('> .controls > .nav');
tab_content = field.find('> .tab-content');
toggler = field.find('> .controls > .btn-group > .toggler');
tab_content.children('.fields:not(.tab-pane)').addClass('tab-pane').each(function() {
$(this).attr('id', 'unique-id-' + (new Date().getTime()) + Math.floor(Math.random() * 100000));
return nav.append('