Sha256: 16c8cb9066fc552a035a84c190c0f6fe98fb6449c7ab3251581692ac79e36f5d
Contents?: true
Size: 1.7 KB
Versions: 14
Compression:
Stored size: 1.7 KB
Contents
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('<img src="'+file.val().replace("original", size)+'" alt="Image">'); editor.windowManager.close(); }); $(".media_insert").on("click", function(e) { e.preventDefault(); if ($(this).data("type").indexOf("image") != -1) { 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('<a href="'+$(this).data("url")+'" target="_blank">'+$(this).data("title")+'</a>'); editor.windowManager.close(); } }) } });
Version data entries
14 entries across 14 versions & 1 rubygems