{:uriI"file:///Users/tvd/.rvm/gems/ruby-2.3.0@alchemy/bundler/gems/alchemy_cms-4e3f2c130b02/app/assets/javascripts/alchemy/alchemy.dirty.js.coffee?type=application/javascript&pipeline=self&id=1e6fdf17d6d631dcba296a3e1fe96c98f70e977fe31d8025febb0cd578ab2570:ET:load_pathI"i/Users/tvd/.rvm/gems/ruby-2.3.0@alchemy/bundler/gems/alchemy_cms-4e3f2c130b02/app/assets/javascripts;T: filenameI"/Users/tvd/.rvm/gems/ruby-2.3.0@alchemy/bundler/gems/alchemy_cms-4e3f2c130b02/app/assets/javascripts/alchemy/alchemy.dirty.js.coffee;T: nameI"alchemy/alchemy.dirty;T:logical_pathI""alchemy/alchemy.dirty.self.js;T:content_typeI"application/javascript;T:sourceI"r (function() { if (typeof window.Alchemy === "undefined") { window.Alchemy = {}; } $.extend(Alchemy, { ElementDirtyObserver: function(selector) { return $(selector).find('input[type="text"], select').change((function(_this) { return function(e) { var $content; $content = $(e.target); $content.addClass('dirty'); _this.setElementDirty($content.closest(".element-editor")); }; })(this)); }, setElementDirty: function(element) { var $element; $element = $(element); $element.addClass('dirty'); $element.find('> .element-header .icon[class*="element_"]').addClass('element_dirty'); return window.onbeforeunload = this.pageUnload; }, pageUnload: function() { Alchemy.pleaseWaitOverlay(false); return Alchemy.t('page_dirty_notice'); }, setElementClean: function(element) { var $element; $element = $(element); $element.removeClass('dirty'); $element.find('> .element-header .icon').removeClass('element_dirty'); $element.find('> .element-content .dirty').removeClass('dirty'); return window.onbeforeunload = void 0; }, isPageDirty: function() { return $('#element_area').find('.element-editor.dirty').length > 0; }, isElementDirty: function(element) { return $(element).hasClass('dirty'); }, checkPageDirtyness: function(element) { var callback; callback = void 0; if ($(element).is("form")) { callback = function() { var $form; $form = $("
"); $form.append($(element).find("input")); $form.appendTo("body"); return $form.submit(); }; } else if ($(element).is("a")) { callback = function() { return window.location.href = element.pathname; }; } if (Alchemy.isPageDirty()) { Alchemy.openConfirmDialog(Alchemy.t('page_dirty_notice'), { title: Alchemy.t('warning'), ok_label: Alchemy.t('ok'), cancel_label: Alchemy.t('cancel'), on_ok: function() { window.onbeforeunload = void 0; Alchemy.pleaseWaitOverlay(); return callback(); } }); return false; } else { return true; } }, PageLeaveObserver: function() { return $('#main_navi a').click(function(event) { if (!Alchemy.checkPageDirtyness(event.currentTarget)) { return event.preventDefault(); } }); } }); }).call(this); ;T: metadata{:dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"file-digest:///Users/tvd/.rvm/gems/ruby-2.3.0@alchemy/bundler/gems/alchemy_cms-4e3f2c130b02/app/assets/javascripts/alchemy/alchemy.dirty.js.coffee;TTF: requiredo;;} F:stubbedo;;} F: linkso;;} F:charsetI" utf-8;F:digest"%8M{h\Ѽ[d\bY^Di:lengthir :dependencies_digest"%X%`(1Aa d0tVY=J:idI"E1e6fdf17d6d631dcba296a3e1fe96c98f70e977fe31d8025febb0cd578ab2570;F: mtimel+X