Plugin Directory

Changeset 1152237


Ignore:
Timestamp:
05/03/2015 02:56:51 PM (11 years ago)
Author:
boyevul
Message:

10.0.4

  • *Release Date - 3rd, May, 2015*
  • jquery version bump from 2.1.3 to 2.1.4 for CDN enqueued jquery
  • fitvids for media embeds, with changes to media embedding to enhance quality of return.
Location:
my-optional-modules/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • my-optional-modules/trunk/_versions.php

    r1129128 r1152237  
    33 * Version information
    44 *
    5  * File last update: 8-RC-1.5.6
     5 * File last update: 10.0.4
    66 *
    77 * Define which versions of (what) to enqueue from CDN, making sure
     
    99 *
    1010 * //cdnjs.com/
    11  * - Last checked 8-RC-1.5.6
     11 * - Last checked 10.0.4
    1212 * - - 1.9.1 //cdnjs.com/libraries/jquery.lazyload
    13  * - - 2.1.3 //cdnjs.com/libraries/jquery
     13 * - - 2.1.4 //cdnjs.com/libraries/jquery
    1414 * - - 1.2.1 //cdnjs.com/libraries/jquery-migrate
    1515 */
     
    2020
    2121$myoptionalmodules_lazyload_version      = esc_url( '//cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js' );
    22 $myoptionalmodules_jquery_version        = esc_url( '//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js' );
     22$myoptionalmodules_jquery_version        = esc_url( '//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js' );
    2323$myoptionalmodules_jquerymigrate_version = esc_url( '//cdnjs.cloudflare.com/ajax/libs/jquery-migrate/1.2.1/jquery-migrate.min.js' );
  • my-optional-modules/trunk/class.mom-mediaembed.php

    r1129128 r1152237  
    33 * CLASS mom_mediaEmbed()
    44 *
    5  * File last update: 9.1.8
     5 * File last update: 10.0.4
    66 *
    77 * Create a media embed from a URL in a template (or other) by passing a
     
    2020    var $url;
    2121
    22     function mom_mediaEmbed ( $url ) {
    23 
     22    function mom_mediaEmbed ( $url , $title = null , $class = null , $size = null ) {
     23
     24        if ( $size ):
     25            $size   = sanitize_text_field ( $size );
     26        endif;
     27       
    2428        $url    = esc_url ( $url );
    2529        $output = $host = $path = $query = $timestamp = $thumbnail = $embed = null;
    26        
    27         $urls = explode ( '::' , $url );
    28        
    29         foreach ( $urls as $url ) {
    30            
    31             $output .= '<div class="media-embed">';
    32            
    33             if ( filter_var( $url, FILTER_VALIDATE_URL ) !== false )
    34                 if ( isset ( parse_url ( $url ) [ 'host'  ] ) )
    35                     $host  = parse_url ( $url ) [ 'host'  ];
    36                 if ( isset ( parse_url ( $url ) [ 'path'  ] ) )
    37                     $path  = parse_url ( $url ) [ 'path'  ];
    38                 if ( isset ( parse_url ( $url ) [ 'query' ] ) )
    39                     $query = parse_url ( $url ) [ 'query' ];
    40 
    41             if ( $host ) {
    42 
    43                 if( strpos ( $host, 'funnyordie.com' ) !== false ) {
     30        $class  = sanitize_text_field ( $class );
     31        $urls   = explode ( '::' , $url );
     32       
     33       
     34        if ( filter_var( $url, FILTER_VALIDATE_URL ) !== false ):
     35            if ( isset ( parse_url ( $url ) [ 'host'  ] ) ):
     36                $host  = parse_url ( $url ) [ 'host'  ];
     37            endif;
     38            if ( isset ( parse_url ( $url ) [ 'path'  ] ) ):
     39                $path  = parse_url ( $url ) [ 'path'  ];
     40            endif;
     41            if ( isset ( parse_url ( $url ) [ 'query' ] ) ):
     42                $query = parse_url ( $url ) [ 'query' ];
     43            endif;
     44        endif;
     45       
     46        if ( $host ):
     47
     48            if( strpos ( $host, 'funnyordie.com' ) !== false ):
     49                $url = explode ( '/' , $url );
     50                $url = $url [ sizeof ( $url ) - 2 ];
     51                $url = sanitize_text_field ( $url );
     52                $output .= "
     53                <object width='640' height='400' id='ordie_player_{$url}' data='http://player.ordienetworks.com/flash/fodplayer.swf'>
     54                    <param name='movie' value='http://player.ordienetworks.com/flash/fodplayer.swf' />
     55                    <param name='flashvars' value='key={$url}' />
     56                    <param name='allowfullscreen' value='true' />
     57                    <param name='allowscriptaccess' value='always'>
     58                    <embed width='640' height='400' flashvars='key={$url}' allowfullscreen='true' allowscriptaccess='always' quality='high' src='http://player.ordienetworks.com/flash/fodplayer.swf' name='ordie_player_5325b03b52' type='application/x-shockwave-flash'></embed>
     59                </object>
     60                ";
     61
     62            // gfycat
     63            elseif( strpos ( $host , 'gfycat.com' ) !== false ):
     64                $url = str_replace ( array ( 'https://' , 'http://' , 'gfycat.com' ), '', $url );
     65                $url = sanitize_text_field ( $url );
     66                $output .= "<iframe src='//gfycat.com/iframe{$url}' frameborder='0' scrolling='no' width='592' height='320' ></iframe>";
     67
     68            // imgur
     69            elseif ( strpos ( $host , 'imgur.com' ) !== false ):
     70                $url = str_replace ( array ( 'https://' , 'http://' , 'imgur.com/a/' , 'i.imgur.com/' ) , '' , $url );
     71                $url = sanitize_text_field ( $url );
     72                if ( strpos ( $path , '/a/' ) !== false ):
     73                    $output .= "<iframe class='imgur-album' src='//imgur.com/a/{$url}/embed'></iframe>";
     74                else:
     75                    $ext = pathinfo($url, PATHINFO_EXTENSION);
     76                    if ( 'webm' == $ext ):
     77                        $url = str_replace ( '.webm' , '.gif' , $url );
     78                    endif;
     79                    if ( 'small' == $size ):
     80                        $small_url = preg_replace('/(.*)(\.[\w\d]{3})/', '$1s$2', $url);
     81                    elseif ( 'medium' == $size ):
     82                        $small_url = preg_replace('/(.*)(\.[\w\d]{3})/', '$1m$2', $url);
     83                    else:
     84                        $small_url = preg_replace('/(.*)(\.[\w\d]{3})/', '$1$2', $url);
     85                    endif;
     86                    $output .= "<a class='imgur-link' href='//i.imgur.com/{$url}'><img data-small='//i.imgur.com/{$small_url}' data-src='//i.imgur.com/{$url}' class='imgur-image' alt='image' src='//i.imgur.com/{$small_url}'/></a>";
     87                endif;
     88
     89            // liveleak
     90            elseif( strpos ( $host , 'liveleak.com' ) !== false ):
     91                $url = str_replace( 'i=', '', $query );
     92                $url = sanitize_text_field ( $url );
     93                $output .= "
     94                <object width='640' height='390' data='http://www.liveleak.com/e/{$url}'>
     95                    <param name='movie' value='http://www.liveleak.com/e/{$url}' />
     96                    <param name='wmode' value='transparent' />
     97                    <embed src='http://www.liveleak.com/e/{$url}'
     98                        type='application/x-shockwave-flash'
     99                        wmode='transparent'
     100                        width='640'
     101                        height='390' />
     102                </object>";
     103
     104            // soundcloud
     105            elseif( strpos ( $host , 'soundcloud.com' ) !== false ):
     106                $url = sanitize_text_field ( $url );
     107                $output .= "<iframe class='soundcloud-embed' src='http://w.soundcloud.com/player/?url={$url}&auto_play=false&color=915f33&theme_color=00FF00'></iframe>";
     108
     109            // vimeo
     110            elseif( strpos( $host , 'vimeo.com' ) !== false ):
     111                $url = explode( '/' , $url );
     112                $url = $url [ sizeof ( $url ) - 1 ];
     113                $url = sanitize_text_field ( $url );
     114                $output .= "<iframe src='//player.vimeo.com/video/{$url}?title=0&amp;byline=0&amp;portrait=0&amp;color=d6cece' class='vimeo-embed' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>";
     115
     116            // vine
     117            elseif( strpos ( $host , 'vine.co' ) !== false && strpos ( $path , 'v' ) !== false ):
     118                $url = sanitize_text_field ( $url );
     119                $output .= "<iframe class='vine-embed' src='{$url}/embed/postcard'></iframe><script async src='//platform.vine.co/static/scripts/embed.js' charset='utf-8'></script>";
     120           
     121            // youtube
     122            elseif ( strpos ( $host , 'youtube.com' ) !== false || strpos ( $host , 'youtu.be' ) !== false ):
     123                if ( strpos ( strtolower ( $url ), '038;t=' ) !== false && strpos ( strtolower ( $url ), 'list=' ) === false ):
     124                    $url_parse = parse_url ( strtolower ( $url ) );
     125                    $timestamp = sanitize_text_field ( str_replace ( '038;t=', '', $url_parse [ 'fragment' ] ) );
     126                    $minutes   = 0;
     127                    $seconds   = 0;
     128                    if ( strpos( $timestamp, 'm' ) !== false && strpos ( $timestamp, 's' ) !== false ):
     129                        $parts     = str_replace ( array ( 'm' , 's' ) , '' , $timestamp );
     130                        list ( $minutes , $seconds ) = $parts = str_split ( $parts );
     131                        $minutes   = $minutes * 60;
     132                        $seconds   = $seconds * 1;
     133                    elseif ( strpos ( $timestamp , 'm' ) !== true && strpos ( $timestamp , 's' ) !== false ):
     134                        $seconds   = str_replace( 's' , '' , $timestamp ) * 1;
     135                    elseif ( strpos ( $timestamp , 'm' ) !== false && strpos ( $timestamp, 's' ) !== true ):
     136                        $minutes   = str_replace ( 'm' , '' , $timestamp ) * 60;
     137                    else:
     138                        $minutes = 0;
     139                        $seconds = 0;
     140                    endif;
     141                    $timestamp = '&amp;start-' . $minutes + $seconds;
     142                endif;
     143
     144                if ( strpos ( $host , 'youtu.be' ) !== false ):
    44145                    $url = explode ( '/' , $url );
    45                     $url = $url [ sizeof ( $url ) - 2 ];
    46                     $url = sanitize_text_field ( $url );
    47                     $output .= "
    48                     <object width='640' height='400' id='ordie_player_{$url}' data='http://player.ordienetworks.com/flash/fodplayer.swf'>
    49                         <param name='movie' value='http://player.ordienetworks.com/flash/fodplayer.swf' />
    50                         <param name='flashvars' value='key={$url}' />
    51                         <param name='allowfullscreen' value='true' />
    52                         <param name='allowscriptaccess' value='always'>
    53                         <embed width='640' height='400' flashvars='key={$url}' allowfullscreen='true' allowscriptaccess='always' quality='high' src='http://player.ordienetworks.com/flash/fodplayer.swf' name='ordie_player_5325b03b52' type='application/x-shockwave-flash'></embed>
     146                    $url = $url [ sizeof ( $url ) - 1 ];
     147                endif;
     148                if ( strpos ( $host , 'youtu.be' ) === false ):
     149                    $url = str_replace ( array ( 'v=' , '&' ) , '' , $query );
     150                endif;
     151                $url       = sanitize_text_field ( $url );
     152                $thumbnail = "//img.youtube.com/vi/{$url}/0.jpg";
     153               
     154               
     155                $output .= "<div id='mom-youtube-{$url}' class='mom-youtube-content-div'>
     156                    <img src='{$thumbnail}' data-time='{$timestamp}' data-video='{$url}' id='mom-youtube-thumbnail-{$url}' class='skipLazy mom-youtube-thumbnail' />
     157                    <i class='mom-youtube-play-button fa fa-play-circle'> &mdash; click thumbnail to play</i>
     158                </div>
     159                <noscript>
     160                    <object width='640' height='390' data='https://www.youtube.com/v/{$url}?version=3{$timestamp}'>
     161                        <param name='movie' value='https://www.youtube.com/v/{$url}?version=3{$timestamp}' />
     162                        <param name='allowScriptAccess' value='always' />
     163                        <embed src='https://www.youtube.com/v/{$url}?version=3{$timestamp}'
     164                        type='application/x-shockwave-flash'
     165                        allowscriptaccess='always'
     166                        width='640'
     167                        height='390' />
    54168                    </object>
    55                     ";
    56                 }
    57 
    58                 // gfycat
    59                 elseif( strpos ( $host , 'gfycat.com' ) !== false ) {
    60                     $url = str_replace ( array ( 'https://' , 'http://' , 'gfycat.com' ), '', $url );
    61                     $url = sanitize_text_field ( $url );
    62                     $output .= "<iframe src='//gfycat.com/iframe{$url}' frameborder='0' scrolling='no' width='592' height='320' ></iframe>";
    63                 }
    64 
    65                 // imgur
    66                 elseif ( strpos ( $host , 'imgur.com' ) !== false ) {
    67                     $url = str_replace ( array ( 'https://' , 'http://' , 'imgur.com/a/' , 'i.imgur.com/' ) , '' , $url );
    68                     $url = sanitize_text_field ( $url );
    69                     if ( strpos ( $path , '/a/' ) !== false )
    70                         $output .= "<iframe class='imgur-album' src='//imgur.com/a/{$url}/embed'></iframe>";
    71                     else
    72                         $output .= "<img class='imgur-image' alt='image' src='//i.imgur.com/{$url}'/>";
    73                 }
    74 
    75                 // liveleak
    76                 elseif( strpos ( $host , 'liveleak.com' ) !== false ) {
    77                     $url = str_replace( 'i=', '', $query );
    78                     $url = sanitize_text_field ( $url );
    79                     $output .= "
    80                     <object width='640' height='390' data='http://www.liveleak.com/e/{$url}'>
    81                         <param name='movie' value='http://www.liveleak.com/e/{$url}' />
    82                         <param name='wmode' value='transparent' />
    83                         <embed src='http://www.liveleak.com/e/{$url}'
    84                             type='application/x-shockwave-flash'
    85                             wmode='transparent'
    86                             width='640'
    87                             height='390' />
    88                     </object>";
    89                 }
    90 
    91                 // soundcloud
    92                 elseif( strpos ( $host , 'soundcloud.com' ) !== false ) {
    93                     $url = sanitize_text_field ( $url );
    94                     $output .= "<iframe class='soundcloud-embed' src='http://w.soundcloud.com/player/?url={$url}&auto_play=false&color=915f33&theme_color=00FF00'></iframe>";
    95                 }
    96 
    97                 // vimeo
    98                 elseif( strpos( $host , 'vimeo.com' ) !== false ) {
    99                     $url = explode( '/' , $url );
    100                     $url = $url [ sizeof ( $url ) - 1 ];
    101                     $url = sanitize_text_field ( $url );
    102                     $output .= "<iframe src='//player.vimeo.com/video/{$url}?title=0&amp;byline=0&amp;portrait=0&amp;color=d6cece' class='vimeo-embed' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>";
    103                 }
    104 
    105                 // vine
    106                 elseif( strpos ( $host , 'vine.co' ) !== false && strpos ( $path , 'v' ) !== false ) {
    107                     $url = sanitize_text_field ( $url );
    108                     $output .= "<iframe class='vine-embed' src='{$url}/embed/postcard'></iframe><script async src='//platform.vine.co/static/scripts/embed.js' charset='utf-8'></script>";
    109                 }
    110                
    111                 // youtube
    112                 elseif ( strpos ( $host , 'youtube.com' ) !== false || strpos ( $host , 'youtu.be' ) !== false ) {
    113                     if ( strpos ( strtolower ( $url ), '038;t=' ) !== false && strpos ( strtolower ( $url ), 'list=' ) === false ) {
    114                         $url_parse = parse_url ( strtolower ( $url ) );
    115                         $timestamp = sanitize_text_field ( str_replace ( '038;t=', '', $url_parse [ 'fragment' ] ) );
    116                         $minutes   = 0;
    117                         $seconds   = 0;
    118                         if ( strpos( $timestamp, 'm' ) !== false && strpos ( $timestamp, 's' ) !== false ) {
    119                             $parts     = str_replace ( array ( 'm' , 's' ) , '' , $timestamp );
    120                             list ( $minutes , $seconds ) = $parts = str_split ( $parts );
    121                             $minutes   = $minutes * 60;
    122                             $seconds   = $seconds * 1;
    123                         } elseif ( strpos ( $timestamp , 'm' ) !== true && strpos ( $timestamp , 's' ) !== false ) {
    124                             $seconds   = str_replace( 's' , '' , $timestamp ) * 1;
    125                         } elseif ( strpos ( $timestamp , 'm' ) !== false && strpos ( $timestamp, 's' ) !== true ) {
    126                             $minutes   = str_replace ( 'm' , '' , $timestamp ) * 60;
    127                         } else {
    128                             $minutes = 0;
    129                             $seconds = 0;
    130                         }
    131                         $timestamp = '&amp;start-' . $minutes + $seconds;
    132                     }
    133                     if ( strpos ( $host , 'youtu.be' ) !== false )
    134                         $url = explode ( '/' , $url );
    135                         $url = $url [ sizeof ( $url ) - 1 ];
    136                     if ( strpos ( $host , 'youtu.be' ) === false )
    137                         $url = str_replace ( array ( 'v=' , '&' ) , '' , $query );
    138            
    139                     $url       = sanitize_text_field ( $url );
    140                     $thumbnail = "//img.youtube.com/vi/{$url}/0.jpg";
    141                    
    142                     $output .= "
    143                     <div id='mom-youtube-{$url}' class='mom-youtube-content-div'>
    144                         <img src='{$thumbnail}' data-time='{$timestamp}' data-video='{$url}' id='mom-youtube-thumbnail-{$url}' class='skipLazy mom-youtube-thumbnail' />
    145                         <i class='mom-youtube-play-button fa fa-play-circle'> &mdash; click thumbnail to play</i>
    146                     </div>
    147                     <noscript>
    148                         <object width='640' height='390' data='https://www.youtube.com/v/{$url}?version=3{$timestamp}'>
    149                             <param name='movie' value='https://www.youtube.com/v/{$url}?version=3{$timestamp}' />
    150                             <param name='allowScriptAccess' value='always' />
    151                             <embed src='https://www.youtube.com/v/{$url}?version=3{$timestamp}'
    152                             type='application/x-shockwave-flash'
    153                             allowscriptaccess='always'
    154                             width='640'
    155                             height='390' />
    156                         </object>
    157                     </noscript>";
    158                 }
    159                
    160                 // gists
    161                 elseif ( strpos ( $host , 'gist.github.com' ) !== false ) {
    162                     $path    = sanitize_text_field ( $path );
    163                     $output .= "<script src='https://gist.github.com{$path}.js'></script>";
    164                 }
    165 
    166                 // embeds not handled by the above
    167                 // codex.wordpress.org/Embeds
    168                 else {
    169                     $url = sanitize_text_field ( $url );
    170                     echo wp_oembed_get ( $url );
    171                 }
    172                
    173                 $output .= '</div>';
    174            
    175             }
    176 
    177         }
    178        
    179         echo $output;
     169                </noscript>";
     170           
     171            // gists
     172            elseif ( strpos ( $host , 'gist.github.com' ) !== false ):
     173                $path    = sanitize_text_field ( $path );
     174                $output .= "<script src='https://gist.github.com{$path}.js'></script>";
     175           
     176            // embeds not handled by the above
     177            // codex.wordpress.org/Embeds
     178            else:
     179                $url = sanitize_text_field ( $url );
     180                $output .= wp_oembed_get ( $url );
     181               
     182                if ( !wp_oembed_get ( $url ) ):
     183                    $output .= '';
     184                endif;
     185               
     186            endif;
     187           
     188       
     189        endif;
     190       
     191        if ( $output ):
     192            echo '<div class="media-embed">';
     193                if ( $class ):
     194                    echo "<div class='{$class}'>";
     195                endif;
     196                if ( 'large' == $size ):
     197                    echo '<div class="media-embed-large-image">';
     198                else:
     199                    echo '<div class="media-embed">';
     200                endif;         
     201                echo $output;
     202                echo '</div>';
     203                if ( $class ):
     204                    echo '</div>';
     205                endif;
     206            echo '</div>';
     207        else:
     208            echo "<p><a href='{$url}'>Attached link</a> <small>(<a href='http://{$host}'>{$host}</a>)</small></p>";
     209        endif;
    180210
    181211    }
  • my-optional-modules/trunk/function.category-ids.php

    r1129128 r1152237  
    1515
    1616    $cat_ids = null;
    17     $cat_ids = get_terms( 
    18         'category',
    19         array( 
    20             'fields' => 'ids',
    21             'get'    => 'all' 
    22         ) 
     17    $cat_ids = get_terms(
     18        'category' ,
     19        array(
     20            'fields' => 'ids' ,
     21            'get'    => 'all'
     22        )
    2323    );
    2424
    25     wp_cache_add( 
    26         'all_category_ids',
    27         $cat_ids,
    28         'category' 
     25    wp_cache_add(
     26        'all_category_ids' ,
     27        $cat_ids ,
     28        'category'
    2929    );
    3030
  • my-optional-modules/trunk/includes/css/myoptionalmodules10.css

    r1132295 r1152237  
    99 */
    1010.media-embed {
    11     border: 1px solid rgba(0,0,0,.1);
    1211    margin: 5px auto;
    1312    padding: 5px;
     
    553552 */
    554553.mom-youtube-content-div {
     554    max-width: 100%;
     555    overflow: hidden;
    555556    position:relative;
    556     overflow: hidden;
    557557}
    558558.mom-youtube-play-button {
     
    574574    cursor: pointer;
    575575    display:none;
     576    max-width: 100%;
    576577    visibility:hidden;
    577578}
  • my-optional-modules/trunk/includes/javascript/script.js

    r1129128 r1152237  
     1;(function( $ ){
     2
     3  'use strict';
     4
     5  $.fn.fitVids = function( options ) {
     6    var settings = {
     7      customSelector: null,
     8      ignore: null
     9    };
     10
     11    if(!document.getElementById('fit-vids-style')) {
     12      // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
     13      var head = document.head || document.getElementsByTagName('head')[0];
     14      var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
     15      var div = document.createElement("div");
     16      div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
     17      head.appendChild(div.childNodes[1]);
     18    }
     19
     20    if ( options ) {
     21      $.extend( settings, options );
     22    }
     23
     24    return this.each(function(){
     25      var selectors = [
     26        'iframe[src*="player.vimeo.com"]',
     27        'iframe[src*="youtube.com"]',
     28        'iframe[src*="youtube-nocookie.com"]',
     29        'iframe[src*="kickstarter.com"][src*="video.html"]',
     30        'object',
     31        'embed'
     32      ];
     33
     34      if (settings.customSelector) {
     35        selectors.push(settings.customSelector);
     36      }
     37
     38      var ignoreList = '.fitvidsignore';
     39
     40      if(settings.ignore) {
     41        ignoreList = ignoreList + ', ' + settings.ignore;
     42      }
     43
     44      var $allVideos = $(this).find(selectors.join(','));
     45      $allVideos = $allVideos.not('object object'); // SwfObj conflict patch
     46      $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.
     47
     48      $allVideos.each(function(count){
     49        var $this = $(this);
     50        if($this.parents(ignoreList).length > 0) {
     51          return; // Disable FitVids on this video.
     52        }
     53        if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
     54        if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))
     55        {
     56          $this.attr('height', 9);
     57          $this.attr('width', 16);
     58        }
     59        var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
     60            width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
     61            aspectRatio = height / width;
     62        if(!$this.attr('id')){
     63          var videoID = 'fitvid' + count;
     64          $this.attr('id', videoID);
     65        }
     66        $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%');
     67        $this.removeAttr('height').removeAttr('width');
     68      });
     69    });
     70  };
     71// Works with either jQuery or Zepto
     72})( window.jQuery || window.Zepto );
     73
    174jQuery(document).ready(function($){
    275   
     
    27100            $( '#mom-youtube-thumbnail-' + mom_youtube_id ).remove();
    28101            $( '#mom-youtube-' + mom_youtube_id + ' .mom-youtube-play-button' ).remove();
     102            $(".media-embed").fitVids();
    29103        });
    30104    });
  • my-optional-modules/trunk/plugin.php

    r1147707 r1152237  
    44Plugin URI:
    55Description: Optional modules and additions for Wordpress.
    6 Version: 10.0.3
     6Version: 10.0.4
    77Author: boyevul
    88Author URI:
  • my-optional-modules/trunk/readme.txt

    r1147707 r1152237  
    44Requires at least: 4.1
    55Tested up to: 4.2
    6 Stable tag: 10.0.3
     6Stable tag: 10.0.4
    77
    88An assortment of functions to enhance WordPress.
     
    7272
    7373== Changelog ==
     74= 10.0.4 =
     75*   *Release Date - 3rd, May, 2015*
     76*   jquery version bump from 2.1.3 to 2.1.4 for CDN enqueued jquery
     77*   fitvids for media embeds, with changes to media embedding to enhance quality of return.
     78
    7479= 10.0.3 =
    7580*   *Release Date - 27th, April, 2015*
    7681*   Further fixing for exclude posts.
     82
    7783= 10.0.2 =
    7884*   *Release Date - 25th, April, 2015*
    7985*   Fix for exclusion module no longer excluding posts.
     86
    8087= 10.0.1 =
    8188*   *Release Date - 13th, April, 2015*
     
    8794
    8895= 9.1.8 =
     96*   *Release Date - 6th, April, 2015*
    8997*   Favicon URL field added
    90 *   *Release Date - 6th, April, 2015*
    9198*   mom_charts shortcode added
    9299*   Horizontal galleries images loaded below on-click
Note: See TracChangeset for help on using the changeset viewer.