{I" class:ETI"ProcessedAsset;FI"logical_path;TI"'alchemy/alchemy.element_editors.js;FI" pathname;TI"†/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+/-TI" length;Ti÷I" digest;TI"%ec6b054c7c1b27f7a14618f4997714e7;FI" source;TI"÷(function() { if (typeof window.Alchemy === 'undefined') { window.Alchemy = {}; } Alchemy.ElementEditors = { init: function() { var $elements, self; $elements = $("#element_area .element_editor"); self = Alchemy.ElementEditors; return self.reinit($elements); }, reinit: function(elements) { var $elements, self; self = Alchemy.ElementEditors; $elements = $(elements); $elements.each(function() { return self.bindEvent(this); }); $elements.find(".element_head").click(self.onClickElement); $elements.find(".element_head").dblclick(function() { var id; id = $(this).parent().attr("id").replace(/\D/g, ""); return self.toggle(id); }); Alchemy.ElementEditors.observeToggler($elements); return Alchemy.ElementEditors.missingContentsObserver($elements); }, onClickElement: function(e) { var $element, id, self; self = Alchemy.ElementEditors; $element = $(this).parent(".element_editor"); id = $element.attr("id").replace(/\D/g, ""); e.preventDefault(); $("#element_area .element_editor").removeClass("selected"); $element.addClass("selected"); self.scrollToElement(this); return self.selectElementInPreview(id); }, selectElementInPreview: function(id) { var $frame_elements, $selected_element; $frame_elements = document.getElementById("alchemy_preview_window").contentWindow.jQuery("[data-alchemy-element]"); $selected_element = $frame_elements.closest("[data-alchemy-element='" + id + "']"); return $selected_element.trigger("Alchemy.SelectElement"); }, bindEvent: function(element) { var self; self = Alchemy.ElementEditors; return $(element).bind("Alchemy.SelectElementEditor", self.selectElement); }, selectElement: function(e) { var $cell, $cells, $element, $elements, id, self; self = Alchemy.ElementEditors; id = this.id.replace(/\D/g, ""); $element = $(this); $elements = $("#element_area .element_editor"); $cells = $("#cells .sortable_cell"); e.preventDefault(); $elements.removeClass("selected"); $element.addClass("selected"); if ($cells.size() > 0) { $cell = $element.parent(".sortable_cell"); $("#cells").tabs("option", "active", $cells.index($cell)); } if ($element.hasClass("folded")) { return self.toggleFold(id); } else { return self.scrollToElement(this); } }, scrollToElement: function(el) { return $("#element_area").scrollTo(el, { duration: 400, offset: -10 }); }, toggle: function(id, text) { var el; el = $("#element_" + id); if (Alchemy.isElementDirty(el)) { Alchemy.openConfirmDialog(Alchemy._t('element_dirty_notice'), { title: Alchemy._t('warning'), ok_label: Alchemy._t('ok'), cancel_label: Alchemy._t('cancel'), on_ok: (function(_this) { return function() { return _this.toggleFold(id); }; })(this) }); return false; } else { return this.toggleFold(id); } }, toggleFold: function(id) { var element, spinner; spinner = Alchemy.Spinner.small(); element = $('.ajax_folder', "#element_" + id); $("#element_" + id + "_folder").hide(); element.prepend(spinner.spin().el); return $.post(Alchemy.routes.fold_admin_element_path(id), (function(_this) { return function() { $("#element_" + id + "_folder").show(); spinner.stop(); return _this.scrollToElement("#element_" + id); }; })(this)); }, observeToggler: function(scope) { return $('[data-element-toggle]', scope).click(function() { return Alchemy.ElementEditors.toggle($(this).data('element-toggle')); }); }, missingContentsObserver: function(scope) { return $('[data-create-missing-content]', scope).click(function() { var $link, querystring, url; $link = $(this); url = this.pathname; querystring = this.search.replace(/\?/, ''); $.post(url, querystring); return false; }); } }; }).call(this); ;TI"dependency_digest;TI"%8a87bfe75c6e51295296e7976bee3d43;FI"required_paths;T[I"†/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee;FI"dependency_paths;T[{I" path;TI"†/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee;FI" mtime;TI"2014-10-02T11:38:55+02:00;TI" digest;TI"%aa84c4f2d4563b8d61ed3ffc61636c63;FI" _version;TI"%1005ed9f20e25fb0a0599a7017dd0e6b;F