{:uriI"file:///Users/tyler/Development/guts/app/assets/javascripts/guts/media.js?type=application/javascript&pipeline=self&id=dc3dd6b55d68967d4908ec71cbacbf3075e8a54cd32081179cee2da01c231271:ET:load_pathI"9/Users/tyler/Development/guts/app/assets/javascripts;T:
filenameI"G/Users/tyler/Development/guts/app/assets/javascripts/guts/media.js;T: nameI"guts/media;T:logical_pathI"guts/media.self.js;T:content_typeI"application/javascript;T:sourceI"jQuery(document).ready(function($) {
$(".media_add").on("click", function() {
$(this).remove();
$(".media_add_new").show();
});
$(".media_destroy").on("click", function(e) {
e.preventDefault();
var $that = $(this);
swal({
title: "Are you sure?",
text: "You will not be able to recover this attachment after deletion.",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: false
}, function() {
swal.close();
$that.parents(".media_block").find("input[type=checkbox]").trigger("click");
$that.parents(".media_block").fadeOut("slow");
});
});
if (window.top.tinymce && window.top != window) {
$(".media_insert").css("display", "inline");
$(document).on("click", "#media_insert_size", function() {
var size = $(this).parent().find("select").val();
var file = $(this).parent().find("#media_insert_file_link");
var editor = window.top.tinymce.editors[0];
editor.insertContent('
');
editor.windowManager.close();
});
$(".media_insert").on("click", function(e) {
e.preventDefault();
if ($(this).data("type").indexOf("image") > 0) {
var modal = $("#media_insert_modal");
$.get($(this).attr("href"), function(resp) { modal.html(resp).foundation("open"); });
} else {
var editor = window.top.tinymce.editors[0];
editor.insertContent(''+$(this).data("title")+'');
editor.windowManager.close();
}
})
}
});
;T:
metadata{:dependencieso:Set:
@hash{ I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"Ufile-digest:///Users/tyler/Development/guts/app/assets/javascripts/guts/media.js;TT:
requiredo;;{ :stubbedo;;{ :
linkso;;{ :charsetI"
utf-8;F:digest"%Pt7f6q͢{":lengthi:dependencies_digest"%~LR
mt|T˓:idI"Edc3dd6b55d68967d4908ec71cbacbf3075e8a54cd32081179cee2da01c231271;F:
mtimel+V