Sha256: 01efa4b9b85c441017f162df41121bbb3b0d2f700f893cafcbbeb42981142c73
Contents?: true
Size: 1.52 KB
Versions: 40
Compression:
Stored size: 1.52 KB
Contents
I"(function() { var PostShow, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; PostShow = (function() { function PostShow() { this.track = bind(this.track, this); this.is_video_embed_url = bind(this.is_video_embed_url, this); this.convert_videos_to_responsive = bind(this.convert_videos_to_responsive, this); this.convert_videos_to_responsive(); this.track(); } PostShow.prototype.convert_videos_to_responsive = function() { var self; self = this; return $(".post-body iframe").each(function() { var $iframe, $wrapper; $iframe = $(this); if (self.is_video_embed_url($iframe.attr('src'))) { $wrapper = $("<div class='embed-responsive embed-responsive-16by9 video-embed-wrap'></div>"); $iframe.removeAttr("width").removeAttr("height").addClass("embed-responsive-item video-embed"); return $iframe.wrap($wrapper); } }); }; PostShow.prototype.is_video_embed_url = function(url) { var provider; provider = url.match(/https?:\/\/(:?www.)?(\w*)/)[2]; if (provider === 'youtube' || provider === 'vimeo' || provider === 'player' || provider === 'youtu.be') { return true; } return false; }; PostShow.prototype.track = function() { return setTimeout(function() { return $.get($(".post").attr("data-tracking-uri")); }, 500); }; return PostShow; })(); window.PostShow = PostShow; }).call(this); :ET
Version data entries
40 entries across 36 versions & 1 rubygems