aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Mathis <brandon@imathis.com>2013-04-04 10:59:18 -0500
committerBrandon Mathis <brandon@imathis.com>2013-04-04 10:59:18 -0500
commit7dfba9a26e21b970f74aa663a86d407ae8fd5958 (patch)
treed51a49f4bc3c89a63e3b30328c9b63aec3a887f5
parent49a27c929d646973ce1f4ed4c93506a10be61b81 (diff)
downloadmy_new_personal_website-7dfba9a26e21b970f74aa663a86d407ae8fd5958.tar.xz
my_new_personal_website-7dfba9a26e21b970f74aa663a86d407ae8fd5958.zip
fixed video wrapping js
-rw-r--r--.themes/classic/source/javascripts/octopress.js18
1 files changed, 6 insertions, 12 deletions
diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js
index 235b5d10..218a0a1a 100644
--- a/.themes/classic/source/javascripts/octopress.js
+++ b/.themes/classic/source/javascripts/octopress.js
@@ -72,10 +72,10 @@ function addCodeLineNumbers() {
function flashVideoFallback(){
var flashplayerlocation = "/assets/jwplayer/player.swf",
flashplayerskin = "/assets/jwplayer/glow/glow.xml";
- $('video').each(function(video){
+ $('video').each(function(i, video){
video = $(video);
if (!Modernizr.video.h264 && swfobject.getFlashPlayerVersion() || window.location.hash.indexOf("flash-test") !== -1){
- video.children('source[src$=mp4]').first().map(function(i, source){
+ video.children('source[src$=mp4]').first().map(i, function(source){
var src = $(source).attr('src'),
id = 'video_'+Math.round(1 + Math.random()*(100000)),
width = video.attr('width'),
@@ -92,18 +92,12 @@ function flashVideoFallback(){
}
function wrapFlashVideos() {
- $('object').each(function(object) {
- object = $(object);
- if ( $('param[name=movie]', object).length ) {
- var wrapper = object.before('<div class="flash-video"><div>').previous();
- $(wrapper).children().append(object);
+ $('object').each(function(i, object) {
+ if( $(object).find('param[name=movie]').length ){
+ $(object).wrap('<div class="flash-video">')
}
});
- $('iframe[src*=vimeo],iframe[src*=youtube]').each(function(iframe) {
- iframe = $(iframe);
- var wrapper = iframe.before('<div class="flash-video"><div>').previous();
- $(wrapper).children().append(iframe);
- });
+ $('iframe[src*=vimeo],iframe[src*=youtube]').wrap('<div class="flash-video">')
}
function renderDeliciousLinks(items) {