Plugin Directory

Changeset 725844


Ignore:
Timestamp:
06/12/2013 06:44:55 PM (13 years ago)
Author:
amit
Message:

added v1.3

Location:
ig-twitter-cards/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ig-twitter-cards/trunk/class-ig-twitter-cards-admin.php

    r723981 r725844  
    171171                </td>
    172172            </tr>
    173 
    174             <tr class="ig-tc-mb-player-ui">
    175                 <td><label for="ig_tc_player_aspect_ratio">Video Aspect Ratio <strong>:</strong></label></td>
    176                 <td>
    177                     <select id="ig_tc_player_aspect_ratio" name="ig_tc_player_aspect_ratio">
    178                         <option value="" selected></option>
    179                         <option value="4:3">4:3</option>
    180                         <option value="16:9">16:9</option>
    181                         <option value="16:10">16:10</option>
    182                     </select>
    183                     <span class="description">Select aspect ratio of video to auto calculate video width or height</span>
    184                 </td>
    185             </tr>
    186 
    187173            <tr class="ig-tc-mb-player-ui">
    188174                <td><label for="ig_tc_player_width">Video Width <strong>:</strong></label><span class="ig-tc-required">*</span></td>
     
    197183                    <input name="ig_tc_player_height" id="ig_tc_player_height" class="regular-text" value="<?php echo esc_attr( $mb_options['player_height'] ); ?>" />
    198184                    <span class="description">Enter video height in pixels</span>
     185                </td>
     186            </tr>
     187            <tr class="ig-tc-mb-player-ui">
     188                <td>&nbsp;</td>
     189                <td>
     190                    <div id="ig_tc_player_aspect_ratio">
     191                        <strong>16:9</strong> = &nbsp;<span id="16-9">0</span> px<br />
     192                        <strong>4:3</strong> = &nbsp;<span id="4-3">0</span> px
     193                    </div>
    199194                </td>
    200195            </tr>
  • ig-twitter-cards/trunk/ig-twitter-cards.php

    r723981 r725844  
    44Plugin URI: http://blog.igeek.info/wp-plugins/ig-twitter-cards/
    55Description: This plugin enables Twitter Cards on a site. Check Twitter Cards documentation for details - https://dev.twitter.com/docs/cards
    6 Version: 1.2
     6Version: 1.3
    77Author: Amit Gupta
    88Author URI: http://blog.igeek.info/
     
    1111
    1212if( ! defined('IG_TWITTER_CARDS_VERSION') ) {
    13     define( 'IG_TWITTER_CARDS_VERSION', 1.2 );
     13    define( 'IG_TWITTER_CARDS_VERSION', 1.3 );
    1414}
    1515
  • ig-twitter-cards/trunk/js/admin.js

    r723666 r725844  
    55 * @since: 2013-02-18
    66 * @version: 2013-04-06
     7 * @version: 2013-06-06
     8 * @version: 2013-06-07
    79 */
    810
     
    1416            $.msg( 'unblock' );
    1517        },
    16         get_aspect_ratio: function() {
    17             var aspect_ratio = $('#ig_tc_player_aspect_ratio').val();
    18 
    19             console.log( 'aspect_ratio = ' + aspect_ratio );
    20 
    21             if( ! aspect_ratio || aspect_ratio === null || aspect_ratio.indexOf( ':' ) <= 0 ) {
    22                 return false;
     18        show_height_per_aspect_ratios: function( value ) {
     19            if( typeof value == 'undefined' || value == null ) {
     20                return;
    2321            }
    2422
    25             return aspect_ratio.split( ':' );
     23            if( ! value || isNaN( value ) || parseInt( value ) < 0 ) {
     24                value = 0;
     25            } else {
     26                value = parseInt( value );
     27            }
     28
     29            var aspect_ratios = [ '16:9', '4:3' ];
     30
     31            for( var i = 0; i < aspect_ratios.length; i++ ) {
     32                var aspect_ratio = aspect_ratios[i].split( ':' );
     33
     34                var height = parseInt( ( parseInt( aspect_ratio[1] ) * parseInt( value ) ) / parseInt( aspect_ratio[0] ) );
     35
     36                var elem_id = aspect_ratio.join('-');
     37                $( '#ig_tc_player_aspect_ratio #' + elem_id ).html( height );
     38            }
    2639        }
    2740    }
     
    96109
    97110    /**
    98      * Calculate height based specified width and aspect ratio selected
     111     * Calculate and show height based on specified width for all defined aspect ratios
    99112     */
    100113    $('#ig_tc_player_width').on( 'keyup', function(){
    101         var aspect_ratio = ig_tc_admin.get_aspect_ratio();
    102 
    103         if( aspect_ratio === false ) {
    104             return;
    105         }
    106 
    107         $('#ig_tc_player_height').val( parseInt( ( parseInt( aspect_ratio[1] ) * parseInt( $('#ig_tc_player_width').val() ) ) / parseInt( aspect_ratio[0] ) ) );
    108     } );
    109 
    110     /**
    111      * Calculate width based specified height and aspect ratio selected
    112      */
    113     $('#ig_tc_player_height').on( 'keyup', function(){
    114         var aspect_ratio = ig_tc_admin.get_aspect_ratio();
    115 
    116         if( aspect_ratio === false ) {
    117             return;
    118         }
    119 
    120         $('#ig_tc_player_width').val( parseInt( ( parseInt( aspect_ratio[0] ) * parseInt( $('#ig_tc_player_height').val() ) ) / parseInt( aspect_ratio[1] ) ) );
     114        ig_tc_admin.show_height_per_aspect_ratios( $('#ig_tc_player_width').val() );
    121115    } );
    122116
  • ig-twitter-cards/trunk/readme.txt

    r723981 r725844  
    6464== ChangeLog ==
    6565
     66= v1.3 =
     67
     68* removed video aspect ratio calculation in card options UI on post screen
     69* added aspect ratio calculation helper text for video height in card options UI on post screen
     70
    6671= v1.2 =
    6772
Note: See TracChangeset for help on using the changeset viewer.