o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1388437013.0224268:@value"{I" class:EFI"BundledAsset; FI"logical_path; FI"mercury/region.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/region.js.coffee; FI"content_type; FI"application/javascript; FI" mtime; FI"2013-12-30T11:31:51-05:00; FI"length; FiüI"digest; F"%aac4b048ad14a86ac386522159658ac1I"source; FI"ü(function() { this.Mercury.Region = (function() { function Region(element, window, options) { this.element = element; this.window = window; this.options = options != null ? options : {}; Mercury.log("building " + (this.type()), this.element, this.options); this.document = this.window.document; this.name = this.element.attr(Mercury.config.regions.identifier); this.history = new Mercury.HistoryBuffer(); this.build(); this.bindEvents(); this.pushHistory(); this.element.data('region', this); } Region.prototype.type = function() { return 'unknown'; }; Region.prototype.build = function() {}; Region.prototype.focus = function() {}; Region.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 || event.isDefaultPrevented()) { return; } if (options.action) { return _this.execCommand(options.action, options); } }); this.element.on('mousemove', function(event) { var snippet; if (_this.previewing || Mercury.region !== _this) { return; } snippet = jQuery(event.target).closest('[data-snippet]'); if (snippet.length) { _this.snippet = snippet; if (_this.snippet.data('snippet')) { return Mercury.trigger('show:toolbar', { type: 'snippet', snippet: _this.snippet }); } } }); return this.element.on('mouseout', function() { if (_this.previewing) { return; } return Mercury.trigger('hide:toolbar', { type: 'snippet', immediately: false }); }); }; Region.prototype.content = function(value, filterSnippets) { var container, snippet, _i, _len, _ref; if (value == null) { value = null; } if (filterSnippets == null) { filterSnippets = false; } if (value !== null) { return this.element.html(value); } else { container = jQuery('