{I" class:ETI"ProcessedAsset; FI"logical_path; TI"alchemy/alchemy.base.js; FI" pathname; TI"q/Users/tvd/.rvm/gems/ruby-2.1.2/gems/alchemy_cms-3.0.0/app/assets/javascripts/alchemy/alchemy.base.js.coffee; FI"content_type; TI"application/javascript; TI" mtime; Tl+9ÚþSI"length; Ti›I"digest; TI"%3de74b73298f1ee7abfd94d6c15ea4da; FI"source; TI"›(function() { if (typeof window.Alchemy === 'undefined') { window.Alchemy = {}; } $.fx.speeds._default = 400; $.extend(Alchemy, { pictureSelector: function() { var $picture_selects, $selected_item_tools; $selected_item_tools = $(".selected_item_tools"); $picture_selects = $(".picture_tool.select input"); $picture_selects.on("change", function() { if ($picture_selects.filter(":checked").size() > 0) { $selected_item_tools.show(); } else { $selected_item_tools.hide(); } if (this.checked) { $(this).parent().addClass("visible").removeClass("hidden"); } else { $(this).parent().removeClass("visible").addClass("hidden"); } }); $("a#edit_multiple_pictures").on("click", function(e) { var $this, picture_ids, url; $this = $(this); picture_ids = $("input:checkbox", "#picture_archive").serialize(); url = $this.attr("href") + "?" + picture_ids; Alchemy.openDialog(url, { title: $this.attr("title"), size: '400x295' }); return false; }); }, pleaseWaitOverlay: function(show) { var $overlay, spinner; if (show == null) { show = true; } $overlay = $('#overlay'); if (show) { spinner = Alchemy.Spinner.medium(); $overlay.append(spinner.spin().el); $overlay.show(); } else { $overlay.find('.spinner').remove(); $overlay.hide(); } }, ImageLoader: function(scope, options) { if (scope == null) { scope = document; } if (options == null) { options = { color: '#fff' }; } return $('img', scope).each(function() { var $parent, image, spinner; image = $(this).hide(); $parent = image.parent(); spinner = Alchemy.Spinner.small(options); spinner.spin($parent[0]); image.on('load', function() { spinner.stop(); return image.fadeIn(400); }); return image.on('error', function() { spinner.stop(); return $parent.html(''); }); }); }, removePicture: function(selector) { var $element, $form_field; $form_field = $(selector); $element = $form_field.parents(".element_editor"); if ($form_field) { $form_field.val(""); $form_field.prev().remove(); $form_field.parent().addClass("missing"); Alchemy.setElementDirty($element); } }, setElementSaved: function(selector) { var $element; $element = $(selector); Alchemy.setElementClean(selector); Alchemy.Buttons.enable($element); return true; }, SelectBox: function(scope) { $("select.alchemy_selectbox", scope).select2({ minimumResultsForSearch: 7, dropdownAutoWidth: true }); }, Buttons: function(options) { $("button, input:submit, a.button").button(options); }, selectOrCreateCellTab: function(cell_name, label) { var $cells, $tab; $cells = $('#cells'); $tab = $("#cell_" + cell_name); if ($tab.length === 0) { $("