o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1358622974.28043: @value"¢ {I" class:EFI"BundledAsset;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-01-19T12:15:59-07:00;FI" length;Fi­I" digest;F"%f787798b75981c74ba17e9be628ed15eI" 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; _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); ;FI"required_assets_digest;F"%05614e6f3705f995f83f70996cb2e168I" _version;F"%6776f581a4329e299531e1d52aa59832