o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1388437013.03382: @value"{I" class:EFI"BundledAsset;FI"logical_path;FI"mercury/regions/image.js;FI" pathname;FI"Ž/Users/jrissler/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/mercury-rails-0.9.0/app/assets/javascripts/mercury/regions/image.js.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2013-12-30T11:31:51-05:00;FI" length;FiýI" digest;F"%163b500cdaf9cc85601a727ca12b38b7I" source;FI"ý(function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; this.Mercury.Regions.Image = (function(_super) { var type; __extends(Image, _super); Image.supported = document.getElementById; Image.supportedText = "Chrome 10+, Firefox 4+, IE 7+, Safari 5+, Opera 8+"; type = 'image'; Image.prototype.type = function() { return type; }; function Image(element, window, options) { this.element = element; this.window = window; this.options = options != null ? options : {}; Image.__super__.constructor.apply(this, arguments); } Image.prototype.bindEvents = function() { var _this = this; Mercury.on('mode', function(event, options) { if (options.mode === 'preview') { return _this.togglePreview(); } }); Mercury.on('focus:frame', function() { if (_this.previewing || Mercury.region !== _this) { return; } return _this.focus(); }); Mercury.on('action', function(event, options) { if (_this.previewing || Mercury.region !== _this) { return; } if (options.action) { return _this.execCommand(options.action, options); } }); this.element.on('dragenter', function(event) { if (_this.previewing) { return; } event.preventDefault(); return event.originalEvent.dataTransfer.dropEffect = 'copy'; }); this.element.on('dragover', function(event) { if (_this.previewing) { return; } event.preventDefault(); return event.originalEvent.dataTransfer.dropEffect = 'copy'; }); this.element.on('drop', function(event) { if (_this.previewing) { return; } if (event.originalEvent.dataTransfer.files.length) { event.preventDefault(); _this.focus(); return Mercury.uploader(event.originalEvent.dataTransfer.files[0]); } }); return this.element.on('focus', function() { return _this.focus(); }); }; Image.prototype.togglePreview = function() { if (this.previewing) { this.previewing = false; this.element.attr(Mercury.config.regions.attribute, type); return this.build(); } else { this.previewing = true; this.element.removeAttr(Mercury.config.regions.attribute); return Mercury.trigger('region:blurred', { region: this }); } }; Image.prototype.focus = function() { if (this.previewing) { return; } Mercury.region = this; Mercury.trigger('region:focused', { region: this }); return Mercury.trigger('region:update', { region: this }); }; Image.prototype.execCommand = function(action, options) { var handler; if (options == null) { options = {}; } Image.__super__.execCommand.apply(this, arguments); if (handler = Mercury.Regions.Image.actions[action]) { return handler.call(this, options); } }; Image.prototype.pushHistory = function() { return this.history.push({ src: this.element.attr('src') }); }; Image.prototype.updateSrc = function(src) { return this.element.attr('src', src); }; Image.prototype.serialize = function() { return { type: type, data: this.dataAttributes(), attributes: { src: this.element.attr('src') } }; }; Image.actions = { undo: function() { var prev; if (prev = this.history.undo()) { return this.updateSrc(prev.src); } }, redo: function() { var next; if (next = this.history.redo()) { return this.updateSrc(next.src); } }, insertImage: function(options) { return this.updateSrc(options.value.src); } }; return Image; })(Mercury.Region); }).call(this); ;FI"required_assets_digest;F"%d50ec1027bf4787332b803c78f0effc2I" _version;F"%6776f581a4329e299531e1d52aa59832