o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1361309866.497608: @value"1 {I" class:EFI"ProcessedAsset;FI"logical_path;FI")showboat/plugins/responsive_frame.js;FI" pathname;FI"`/Users/mkitt/Sites/showboat/app/assets/javascripts/showboat/plugins/responsive_frame.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2013-02-19T14:37:39-07:00;FI" length;FiãI" digest;F"%8861d1e3aa00d17f1dc551302db2bd39I" source;FI"ã(function() { var __slice = [].slice; window.ResponsiveFrame = (function() { function ResponsiveFrame(reveal) { var _this = this; this.reveal = reveal; this.frames = document.querySelectorAll('.media-template > iframe'); if (!this.frames.length) { return; } _.defer(function() { return _this.initialize(); }); } ResponsiveFrame.prototype.initialize = function() { this.sample_media = document.querySelector('.media-template > img') || this.frames[0]; this.sample_parent = this.sample_media.parentNode; this.setRatios(); this.addListeners(); return this.resize(); }; ResponsiveFrame.prototype.resize = function(e) { var frame, hv, percent, ratio, wv, _i, _len, _ref, _results; percent = this.sample_media.offsetWidth / this.sample_parent.offsetWidth; if (_.isNaN(percent)) { return; } _ref = this.frames; _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { frame = _ref[_i]; ratio = frame.getAttribute('data-ratio'); wv = Math.round(frame.parentNode.offsetWidth * percent); hv = Math.round(wv * ratio); frame.setAttribute('width', wv); _results.push(frame.setAttribute('height', hv)); } return _results; }; ResponsiveFrame.prototype.addListeners = function() { var _this = this; window.addEventListener('resize', function() { return _this.resize.apply(_this, __slice.call(arguments).concat([false])); }); return this.reveal.addEventListener('slidechanged', function() { return _this.resize.apply(_this, arguments); }); }; ResponsiveFrame.prototype.setRatios = function() { var frame, hv, ratio, wv, _i, _len, _ref, _results; _ref = this.frames; _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { frame = _ref[_i]; wv = frame.getAttribute('width') || frame.offsetWidth; hv = frame.getAttribute('height') || frame.offsetHeight; ratio = hv / wv; _results.push(frame.setAttribute('data-ratio', ratio)); } return _results; }; return ResponsiveFrame; })(); }).call(this); ;TI"dependency_digest;F"%b07120839f7847f2efcabe3515a5ace0I"required_paths;F[I"`/Users/mkitt/Sites/showboat/app/assets/javascripts/showboat/plugins/responsive_frame.coffee;FI"dependency_paths;F[{I" path;FI"`/Users/mkitt/Sites/showboat/app/assets/javascripts/showboat/plugins/responsive_frame.coffee;FI" mtime;FI"2013-02-19T14:37:39-07:00;FI" digest;F"%ca985e3f146e07ba9703f9a134466296I" _version;F"%6776f581a4329e299531e1d52aa59832