{I" class:ETI"BundledAsset;FI"logical_path;TI"storytime/media.js;FI" pathname;TI"b/Users/ben/Documents/benroesch.com/storytime/app/assets/javascripts/storytime/media.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+˝ĂSI" length;TibI" digest;TI"%6af5621e9328129322ff4cd0dd5f27a8;FI" source;TI"b(function() { Storytime.Dashboard.Media = (function() { function Media() {} Media.prototype.initIndex = function() { this.initUpload(); return this.initPagination(); }; Media.prototype.initPagination = function() { return $(document).on('ajax:success', '#media_gallery .pagination a', function(e, data, status, xhr) { return $("#media_gallery").html(data); }); }; Media.prototype.initUpload = function() { var _ref; if (!this.uploadInitialized) { $('#media_file').fileupload({ dataType: 'json', done: function(e, data) { return $("#media_gallery").prepend(data.result.html); }, progressall: function(e, data) { var progress; progress = parseInt(data.loaded / data.total * 100, 10); return $('#progress .progress-bar').css('width', progress + '%'); } }).prop('disabled', !$.support.fileInput).parent().addClass((_ref = $.support.fileInput) != null ? _ref : { undefined: 'disabled' }); return this.uploadInitialized = true; } }; Media.prototype.initInsert = function() { return $(document).on("click", ".insert-image-button", function(e) { var wysihtml5Editor; e.preventDefault(); wysihtml5Editor = $("textarea.wysiwyg").data("wysihtml5").editor; wysihtml5Editor.composer.commands.exec("insertImage", { src: $(this).data("image-url") }); return $("#insertMediaModal").modal("hide"); }); }; return Media; })(); }).call(this); ;TI"required_assets_digest;TI"%d6a0762e0a6fbbec095adb3d4b9494fb;FI" _version;TI"%2b66aa67c90052d553e0328c249bc9b0;F