File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ div.tiny-bulk-optimization div.optimize div.progressbar div.progress {
261261 }
262262}
263263
264- # tiny-bulk-optimization > div .dashboard > div .statistics td .item .costs > div .cost-currency {
264+ div . tiny-bulk-optimization > div .dashboard > div .statistics td .item .costs > div .cost-currency {
265265 display : inline-block;
266266}
267267
Original file line number Diff line number Diff line change 211211 }
212212 } ) ;
213213
214- jQuery ( '.tooltip' ) . mouseenter ( function ( ) {
215- jQuery ( this ) . find ( '.tip' ) . show ( )
216- clearTimeout ( '.tooltip' )
217- } )
218-
219- jQuery ( '.tooltip' ) . mouseleave ( function ( ) {
220- var that = this
221- toolTip = setTimeout ( function ( ) {
222- if ( jQuery ( that ) . find ( '.tip' ) . is ( ':visible' ) ) {
223- jQuery ( '.tip' ) . hide ( )
224- }
225- } , 150 )
226- } )
214+ function attachToolTipEventHandlers ( ) {
215+ var tooltip = '#tiny-bulk-optimization div.tooltip'
216+ var tip = 'div.tip'
217+ var toolTipTimeout = null
218+ jQuery ( tooltip ) . mouseleave ( function ( ) {
219+ var that = this
220+ toolTipTimeout = setTimeout ( function ( ) {
221+ if ( jQuery ( that ) . find ( tip ) . is ( ':visible' ) ) {
222+ jQuery ( tooltip ) . find ( tip ) . hide ( )
223+ }
224+ } , 100 )
225+ } )
226+ jQuery ( tooltip ) . mouseenter ( function ( ) {
227+ jQuery ( this ) . find ( tip ) . show ( )
228+ clearTimeout ( toolTipTimeout )
229+ } )
230+ jQuery ( tooltip ) . find ( tip ) . mouseenter ( function ( ) {
231+ clearTimeout ( toolTipTimeout )
232+ } )
233+ }
227234
228- jQuery ( '.tip' ) . mouseenter ( function ( ) {
229- clearTimeout ( toolTip )
230- } )
235+ attachToolTipEventHandlers ( )
231236
232237 window . bulkOptimizationAutorun = startBulkOptimization
233238 window . bulkOptimization = prepareBulkOptimization
Original file line number Diff line number Diff line change 114114 }
115115 ?>
116116 </p>
117- <p><b>1 image = <?php echo sizeof ( $ active_tinify_sizes ) ?> compressions</b></p><p> <a href="/wp-admin/options-media.php#tiny-compress-images">Change Settings</a></p>
117+ <p>
118+ For each uploaded image, <b> <?php echo sizeof ( $ active_tinify_sizes ) ?> image sizes </b>are compressed. You can changed these settings
119+ <a href="/wp-admin/options-media.php#tiny-compress-images">here</a>.
120+ </p>
118121 </div>
119122 </div>
120123 </td>
124127 </h3>
125128 <span id="estimated-cost">$ <?php echo number_format ( $ estimated_costs , 2 ) ?> </span>
126129 <div class="cost-currency">USD</div>
127-
128- <div class="tooltip">
129- <span class="dashicons dashicons-info"></span>
130- <div class="tip">
131- <p>If you wish to compress more than <b>500 images a month</b> and you are still on a free account <a href="https://tinypng.com/developers">upgrade here.</a></p>
130+ <?php if ($ estimated_costs > 0 ): ?>
131+ <div class="tooltip">
132+ <span class="dashicons dashicons-info"></span>
133+ <div class="tip">
134+ <p>
135+ If you wish to compress more than <b>500 image sizes</b> a month and you are still on a free account
136+ <a href="https://tinypng.com/developers">upgrade here.</a>
137+ </p>
138+ </div>
132139 </div>
133- </div>
134-
140+ <? endif ; ?>
135141 </td>
136142 </tr>
137143 </table>
Original file line number Diff line number Diff line change @@ -79,6 +79,6 @@ public function test_start_bulk_optimization_should_optimize_remaining_images()
7979 }
8080
8181 public function test_should_display_tooltips () {
82- $ this ->assertEquals ( '2 ' , sizeof ($ this ->find_all ( 'div.tip ' )));
82+ $ this ->assertGreaterThanOrEqual ( '1 ' , sizeof ($ this ->find_all ( 'div.tip ' )));
8383 }
8484}
You can’t perform that action at this time.
0 commit comments