Changeset 725844
- Timestamp:
- 06/12/2013 06:44:55 PM (13 years ago)
- Location:
- ig-twitter-cards/trunk
- Files:
-
- 4 edited
-
class-ig-twitter-cards-admin.php (modified) (2 diffs)
-
ig-twitter-cards.php (modified) (2 diffs)
-
js/admin.js (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ig-twitter-cards/trunk/class-ig-twitter-cards-admin.php
r723981 r725844 171 171 </td> 172 172 </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 187 173 <tr class="ig-tc-mb-player-ui"> 188 174 <td><label for="ig_tc_player_width">Video Width <strong>:</strong></label><span class="ig-tc-required">*</span></td> … … 197 183 <input name="ig_tc_player_height" id="ig_tc_player_height" class="regular-text" value="<?php echo esc_attr( $mb_options['player_height'] ); ?>" /> 198 184 <span class="description">Enter video height in pixels</span> 185 </td> 186 </tr> 187 <tr class="ig-tc-mb-player-ui"> 188 <td> </td> 189 <td> 190 <div id="ig_tc_player_aspect_ratio"> 191 <strong>16:9</strong> = <span id="16-9">0</span> px<br /> 192 <strong>4:3</strong> = <span id="4-3">0</span> px 193 </div> 199 194 </td> 200 195 </tr> -
ig-twitter-cards/trunk/ig-twitter-cards.php
r723981 r725844 4 4 Plugin URI: http://blog.igeek.info/wp-plugins/ig-twitter-cards/ 5 5 Description: This plugin enables Twitter Cards on a site. Check Twitter Cards documentation for details - https://dev.twitter.com/docs/cards 6 Version: 1. 26 Version: 1.3 7 7 Author: Amit Gupta 8 8 Author URI: http://blog.igeek.info/ … … 11 11 12 12 if( ! defined('IG_TWITTER_CARDS_VERSION') ) { 13 define( 'IG_TWITTER_CARDS_VERSION', 1. 2);13 define( 'IG_TWITTER_CARDS_VERSION', 1.3 ); 14 14 } 15 15 -
ig-twitter-cards/trunk/js/admin.js
r723666 r725844 5 5 * @since: 2013-02-18 6 6 * @version: 2013-04-06 7 * @version: 2013-06-06 8 * @version: 2013-06-07 7 9 */ 8 10 … … 14 16 $.msg( 'unblock' ); 15 17 }, 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; 23 21 } 24 22 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 } 26 39 } 27 40 } … … 96 109 97 110 /** 98 * Calculate height based specified width and aspect ratio selected111 * Calculate and show height based on specified width for all defined aspect ratios 99 112 */ 100 113 $('#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() ); 121 115 } ); 122 116 -
ig-twitter-cards/trunk/readme.txt
r723981 r725844 64 64 == ChangeLog == 65 65 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 66 71 = v1.2 = 67 72
Note: See TracChangeset
for help on using the changeset viewer.