{:uriI"file:///Users/barnabyalter/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/umlaut-4.1.7/app/assets/javascripts/umlaut/ajax_windows.js?type=application/javascript&pipeline=self&id=0ae8bb3f884f8a84f83b5b52f2140503ea3a58c602ea40dee27a6fc7b527d098:ET:load_pathI"k/Users/barnabyalter/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/umlaut-4.1.7/app/assets/javascripts;T: filenameI"}/Users/barnabyalter/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/umlaut-4.1.7/app/assets/javascripts/umlaut/ajax_windows.js;T: nameI"umlaut/ajax_windows;T:logical_pathI" umlaut/ajax_windows.self.js;T:content_typeI"application/javascript;T:sourceI"@/* ajax_windows.js. Support for modal popup windows in Umlaut items. */ jQuery(document).ready(function($) { var populate_modal = function(data, textStatus, jqXHR) { // Wrap the data object in jquery object var body = $("
").html(data); // Remove the first heading from the returned data var header = body.find("h1, h2, h3, h4, h5, h6").eq(0).remove(); // Remove the first submit button from the returned data var footer = body.find("form").find("input[type=submit]").eq(0).remove(); // Add in content if (header) $("#modal").find("[data-role=modal-title-content]").text(header.text()); if (body) $("#modal").find("[data-role=modal-body-content]").html(body.html()); if (footer) $("#modal").find("[data-role=modal-footer-content]").html(footer); // Toggle the ajax-loader $("#modal").find(".ajax-loader").hide(); } var cleanup_modal = function() { $("#modal").find("[data-role=modal-title-content]").text(''); $("#modal").find("[data-role=modal-body-content]").text(''); $("#modal").find("[data-role=modal-footer-content]").text(''); $("#modal").find(".ajax-loader").hide(); } var display_modal = function(event) { event.preventDefault(); cleanup_modal(); $("#modal").find(".ajax-loader").show(); $("#modal").modal("show"); $.get(this.href, "", populate_modal, "html"); } var ajax_form_catch = function(event) { event.preventDefault(); $("#modal").find(".ajax-loader").show(); var form = $("#modal").find("form"); $.post(form.attr("action"), form.serialize(), populate_modal, "html"); cleanup_modal(); }; $(document).on("click", "a.ajax_window", display_modal); $(document).on("click", "#modal .modal-footer input[type=submit]", ajax_form_catch); $(document).on("submit", "#modal form", ajax_form_catch); }); ;T: metadata{:dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"file-digest:///Users/barnabyalter/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/umlaut-4.1.7/app/assets/javascripts/umlaut/ajax_windows.js;TTF: requiredo;;} F:stubbedo;;} F: linkso;;} F:charsetI" utf-8;F:digest"%Pb>o{`կۥ`i6莲\C:lengthi@:dependencies_digest"%yOK;hK۴Ir[:idI"E0ae8bb3f884f8a84f83b5b52f2140503ea3a58c602ea40dee27a6fc7b527d098;F: mtimel+dW