Ticket #21480: fitvids2.diff
File fitvids2.diff, 1.8 KB (added by , 11 years ago) |
---|
-
wp-content/themes/twentytwelve/js/theme.js
38 38 } 39 39 }, 200 ); 40 40 } ); 41 42 $('.responsive-video').fitVids(); 41 43 } ); 44 No newline at end of file -
wp-content/themes/twentytwelve/functions.php
101 101 wp_enqueue_script( 'comment-reply' ); 102 102 103 103 /** 104 * FitVids adds responsiveness for videos. 105 */ 106 wp_enqueue_script( 'twentytwelve-fitvids', get_template_directory_uri() . '/js/fitvids.js', array( 'jquery' ), '20120802', true ); 107 108 /** 104 109 * JavaScript for handling navigation menus and the resized 105 110 * styles for small screen sizes. 106 111 */ 107 wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/theme.js', array( 'jquery' ), '20120802', true );112 wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/theme.js', array( 'jquery', 'twentytwelve-fitvids' ), '20120802', true ); 108 113 109 114 /** 110 115 * Load special font CSS file. … … 164 169 add_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 ); 165 170 166 171 /** 172 * Add post class responsive-video that fitvids can target 173 * 174 * @since Twenty Twelve 1.0 175 */ 176 function twentytwelve_responsive_video_post_class($classes){ 177 $classes[] = 'responsive-video'; 178 return $classes; 179 } 180 add_filter('post_class', 'twentytwelve_responsive_video_post_class'); 181 182 /** 167 183 * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. 168 184 * 169 185 * @since Twenty Twelve 1.0