Simple Image Sizes - Version 2.3

Version Description

Download this release

Release Info

Developer Rahe
Plugin Icon wp plugin Simple Image Sizes
Version 2.3
Comparing to
See all releases

Code changes from version 2.2.5 to 2.3

inc/class.admin.php CHANGED
@@ -15,14 +15,19 @@ Class SISAdmin {
15
  add_action('wp_ajax_add_size', array( &$this, 'ajaxAddSize' ) );
16
  add_action('wp_ajax_remove_size', array( &$this, 'ajaxRemoveSize' ) );
17
 
18
- // Add image sizes in the form
19
- add_filter( 'attachment_fields_to_edit', array( &$this, 'sizesInForm' ), 11, 2 ); // Add our sizes to media forms
 
 
 
 
20
 
21
  // Add link in plugins list
22
  add_filter('plugin_action_links', array( &$this,'addSettingsLink'), 10, 2 );
23
 
24
  // Add action in media row quick actions
25
  add_filter( 'media_row_actions', array(&$this, 'addActionsList'), 10, 2 );
 
26
  }
27
 
28
  /**
@@ -90,6 +95,7 @@ Class SISAdmin {
90
  'messageRegenerated' => __( 'images have been regenerated !', 'sis' ),
91
  'validateButton' => __( 'Validate', 'sis' ),
92
  'startedAt' => __( ' started at', 'sis' ),
 
93
  'finishedAt' => __( ' finished at :', 'sis' ),
94
  'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'sis' ),
95
  'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'sis' ),
@@ -218,27 +224,33 @@ Class SISAdmin {
218
  $crop = isset( $sizes[$args['name']]['c'] ) && !empty( $sizes[$args['name']]['c'] )? $sizes[$args['name']]['c'] : $args['c'] ;
219
  $show = isset( $sizes[$args['name']]['s'] ) && !empty( $sizes[$args['name']]['s'] )? '1' : '0' ;
220
  $custom = isset( $sizes[$args['name']]['custom'] ) && !empty( $sizes[$args['name']]['custom'] )? '1' : '0' ;
 
 
221
  ?>
222
- <input type="hidden" value="<?php esc_attr_e( $args['name'] ); ?>" name="image_name" />
223
  <?php if( $custom ): ?>
224
- <input name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][custom]' ); ?>" type="hidden" id="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][custom]' ); ?>" value="1" />
225
  <?php else: ?>
226
- <input name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][theme]' ); ?>" type="hidden" id="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][theme]' ); ?>" value="1" />
227
  <?php endif; ?>
228
- <label class="sis-label" for="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][w]' ); ?>">
229
  <?php _e( 'Maximum width', 'sis'); ?>
230
- <input name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][w]' ); ?>" class='w small-text' type="number" step='1' min='0' id="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][w]' ); ?>" base_w='<?php esc_attr_e( $width ); ?>' value="<?php esc_attr_e( $width ); ?>" />
231
  </label>
232
  <label class="sis-label" for="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][h]' ); ?>">
233
  <?php _e( 'Maximum height', 'sis'); ?>
234
- <input name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][h]' ); ?>" class='h small-text' type="number" step='1' min='0' id="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][h]' ); ?>" base_h='<?php esc_attr_e( $height ); ?>' value="<?php esc_attr_e( $height ); ?>" />
 
 
 
 
235
  </label>
236
  <span class="size_options">
237
- <input type='checkbox' id="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" <?php checked( $crop, 1 ) ?> class="c crop" base_c='<?php esc_attr_e( $crop ); ?>' name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" value="1" />
238
- <label class="c" for="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][c]' ); ?>"><?php _e( 'Crop ?', 'sis'); ?></label>
239
 
240
- <input type='checkbox' id="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][s]'); ?>" <?php checked( $show, 1 ) ?> class="s show" base_s='<?php esc_attr_e( $show ); ?>' name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][s]'); ?>" value="1" />
241
- <label class="s" for="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][s]'); ?>"><?php _e( 'Show in post insertion ?', 'sis'); ?></label>
242
  </span>
243
  <span class="delete_size"><?php _e( 'Delete', 'sis'); ?></span>
244
  <span class="add_size validate_size"><?php _e( 'Update', 'sis'); ?></span>
@@ -293,7 +305,7 @@ Class SISAdmin {
293
  */
294
  public function thumbnailRegenerate() {
295
  // Get the sizes
296
- global $_wp_additional_image_sizes;
297
  ?>
298
  <input type="hidden" class="addSize" value='<?php echo wp_create_nonce( 'add_size' ); ?>' />
299
  <input type="hidden" class="regen" value='<?php echo wp_create_nonce( 'regen' ); ?>' />
@@ -336,21 +348,21 @@ Class SISAdmin {
336
  ?>
337
  <tr>
338
  <th class="check-column">
339
- <input type="checkbox" class="thumbnails" id="<?php echo $s ?>" name="thumbnails[]" checked="checked" value="<?php echo esc_attr( $s ); ?>" />
340
  </th>
341
  <th>
342
  <label for="<?php esc_attr_e( $s ); ?>">
343
- <?php esc_html_e( $s ); ?>
344
  </label>
345
  </th>
346
  <th>
347
  <label for="<?php esc_attr_e( $s ); ?>">
348
- <?php esc_html_e( $width); ?> px
349
  </label>
350
  </th>
351
  <th>
352
  <label for="<?php esc_attr_e( $s ); ?>">
353
- <?php esc_html_e( $height ); ?> px
354
  </label>
355
  </th>
356
  <th>
@@ -383,7 +395,10 @@ Class SISAdmin {
383
  <tbody>
384
  <?php
385
  // Diplay the post types table
386
- foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $ptype ):
 
 
 
387
  ?>
388
  <tr>
389
  <th class="check-column">
@@ -393,7 +408,7 @@ Class SISAdmin {
393
  </th>
394
  <th>
395
  <label for="<?php esc_attr_e( $ptype->name ); ?>">
396
- <em><?php esc_html_e( $ptype->labels->name ); ?></em>
397
  </label>
398
  </th>
399
  </tr>
@@ -462,6 +477,7 @@ Class SISAdmin {
462
  $width = !isset( $_POST['width'] )? 0 : absint( $_POST['width'] );
463
  $crop = isset( $_POST['crop'] ) && $_POST['crop'] == 'false' ? false : true;
464
  $show = isset( $_POST['show'] ) && $_POST['show'] == 'false' ? false : true;
 
465
 
466
  // Check the nonce
467
  if( !wp_verify_nonce( $nonce , 'add_size' ) ) {
@@ -476,7 +492,7 @@ Class SISAdmin {
476
  }
477
 
478
  // Make values
479
- $values = array( 'custom' => 1, 'w' => $width , 'h' => $height, 'c' => $crop, 's' => $show );
480
 
481
  // If the size have not changed return 2
482
  if( isset( $sizes[$name] ) && $sizes[$name] === $values ) {
@@ -730,6 +746,7 @@ Class SISAdmin {
730
  if ( $image_meta )
731
  $metadata['image_meta'] = $image_meta;
732
  }
 
733
  return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
734
  }
735
 
@@ -752,8 +769,9 @@ Class SISAdmin {
752
 
753
  if ( is_array( $sizes_custom ) ) {
754
  foreach( $sizes_custom as $key => $value ) {
755
- if( isset( $value['s'] ) && $value['s'] == 1 )
756
- $size_names[$key] = $key;
 
757
  }
758
  }
759
  foreach ( $size_names as $size => $label ) {
@@ -799,5 +817,65 @@ Class SISAdmin {
799
 
800
  return $form_fields;
801
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
802
  }
803
  ?>
15
  add_action('wp_ajax_add_size', array( &$this, 'ajaxAddSize' ) );
16
  add_action('wp_ajax_remove_size', array( &$this, 'ajaxRemoveSize' ) );
17
 
18
+ // Add image sizes in the form, check if 3.3 is installed or not
19
+ if( !function_exists( 'is_main_query' ) ) {
20
+ add_filter( 'attachment_fields_to_edit', array( &$this, 'sizesInForm' ), 11, 2 ); // Add our sizes to media forms
21
+ } else {
22
+ add_filter( 'image_size_names_choose', array( &$this, 'AddThumbnailName' ) );
23
+ }
24
 
25
  // Add link in plugins list
26
  add_filter('plugin_action_links', array( &$this,'addSettingsLink'), 10, 2 );
27
 
28
  // Add action in media row quick actions
29
  add_filter( 'media_row_actions', array(&$this, 'addActionsList'), 10, 2 );
30
+
31
  }
32
 
33
  /**
95
  'messageRegenerated' => __( 'images have been regenerated !', 'sis' ),
96
  'validateButton' => __( 'Validate', 'sis' ),
97
  'startedAt' => __( ' started at', 'sis' ),
98
+ 'customName' => __( 'Public name', 'sis' ),
99
  'finishedAt' => __( ' finished at :', 'sis' ),
100
  'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'sis' ),
101
  'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'sis' ),
224
  $crop = isset( $sizes[$args['name']]['c'] ) && !empty( $sizes[$args['name']]['c'] )? $sizes[$args['name']]['c'] : $args['c'] ;
225
  $show = isset( $sizes[$args['name']]['s'] ) && !empty( $sizes[$args['name']]['s'] )? '1' : '0' ;
226
  $custom = isset( $sizes[$args['name']]['custom'] ) && !empty( $sizes[$args['name']]['custom'] )? '1' : '0' ;
227
+ $name = isset( $sizes[$args['name']]['n'] ) && !empty( $sizes[$args['name']]['n'] )? esc_html( $sizes[$args['name']]['n'] ) : esc_html( $args['name'] ) ;
228
+
229
  ?>
230
+ <input type="hidden" value="<?php echo esc_attr( $args['name'] ); ?>" name="image_name" />
231
  <?php if( $custom ): ?>
232
+ <input name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][custom]' ); ?>" type="hidden" id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][custom]' ); ?>" value="1" />
233
  <?php else: ?>
234
+ <input name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][theme]' ); ?>" type="hidden" id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][theme]' ); ?>" value="1" />
235
  <?php endif; ?>
236
+ <label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][w]' ); ?>">
237
  <?php _e( 'Maximum width', 'sis'); ?>
238
+ <input name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][w]' ); ?>" class='w small-text' type="number" step='1' min='0' id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][w]' ); ?>" base_w='<?php echo esc_attr( $width ); ?>' value="<?php echo esc_attr( $width ); ?>" />
239
  </label>
240
  <label class="sis-label" for="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][h]' ); ?>">
241
  <?php _e( 'Maximum height', 'sis'); ?>
242
+ <input name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][h]' ); ?>" class='h small-text' type="number" step='1' min='0' id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][h]' ); ?>" base_h='<?php echo esc_attr( $height ); ?>' value="<?php echo esc_attr( $height ); ?>" />
243
+ </label>
244
+ <label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][n]' ); ?>">
245
+ <?php _e( 'Public name', 'sis'); ?>
246
+ <input name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][n]' ); ?>" class='n' type="text" id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][n]' ); ?>" base_n='<?php echo $name; ?>' value="<?php echo $name ?>" />
247
  </label>
248
  <span class="size_options">
249
+ <input type='checkbox' id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" <?php checked( $crop, 1 ) ?> class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" value="1" />
250
+ <label class="c" for="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>"><?php _e( 'Crop ?', 'sis'); ?></label>
251
 
252
+ <input type='checkbox' id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][s]'); ?>" <?php checked( $show, 1 ) ?> class="s show" base_s='<?php echo esc_attr( $show ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][s]'); ?>" value="1" />
253
+ <label class="s" for="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][s]'); ?>"><?php _e( 'Show in post insertion ?', 'sis'); ?></label>
254
  </span>
255
  <span class="delete_size"><?php _e( 'Delete', 'sis'); ?></span>
256
  <span class="add_size validate_size"><?php _e( 'Update', 'sis'); ?></span>
305
  */
306
  public function thumbnailRegenerate() {
307
  // Get the sizes
308
+ global $_wp_additional_image_sizes,$_wp_post_type_features;
309
  ?>
310
  <input type="hidden" class="addSize" value='<?php echo wp_create_nonce( 'add_size' ); ?>' />
311
  <input type="hidden" class="regen" value='<?php echo wp_create_nonce( 'regen' ); ?>' />
348
  ?>
349
  <tr>
350
  <th class="check-column">
351
+ <input type="checkbox" class="thumbnails" id="<?php echo esc_attr( $s ) ?>" name="thumbnails[]" checked="checked" value="<?php echo esc_attr( $s ); ?>" />
352
  </th>
353
  <th>
354
  <label for="<?php esc_attr_e( $s ); ?>">
355
+ <?php echo esc_html( $s ); ?>
356
  </label>
357
  </th>
358
  <th>
359
  <label for="<?php esc_attr_e( $s ); ?>">
360
+ <?php echo esc_html( $width); ?> px
361
  </label>
362
  </th>
363
  <th>
364
  <label for="<?php esc_attr_e( $s ); ?>">
365
+ <?php echo esc_html( $height ); ?> px
366
  </label>
367
  </th>
368
  <th>
395
  <tbody>
396
  <?php
397
  // Diplay the post types table
398
+ foreach ( get_post_types( array( 'public' => true, '_builtin' => false ), 'objects', 'or' ) as $ptype ):
399
+ // Avoid the post_types without post thumbnails feature
400
+ if( !array_key_exists( 'thumbnail' , $_wp_post_type_features[$ptype->name] ) || $_wp_post_type_features[$ptype->name] == false )
401
+ continue;
402
  ?>
403
  <tr>
404
  <th class="check-column">
408
  </th>
409
  <th>
410
  <label for="<?php esc_attr_e( $ptype->name ); ?>">
411
+ <em><?php echo esc_html( $ptype->labels->name ); ?></em>
412
  </label>
413
  </th>
414
  </tr>
477
  $width = !isset( $_POST['width'] )? 0 : absint( $_POST['width'] );
478
  $crop = isset( $_POST['crop'] ) && $_POST['crop'] == 'false' ? false : true;
479
  $show = isset( $_POST['show'] ) && $_POST['show'] == 'false' ? false : true;
480
+ $cn = isset( $_POST['customName'] ) && !empty( $_POST['customName'] ) ? sanitize_text_field( $_POST['customName'] ): $name ;
481
 
482
  // Check the nonce
483
  if( !wp_verify_nonce( $nonce , 'add_size' ) ) {
492
  }
493
 
494
  // Make values
495
+ $values = array( 'custom' => 1, 'w' => $width , 'h' => $height, 'c' => $crop, 's' => $show, 'n' => $cn );
496
 
497
  // If the size have not changed return 2
498
  if( isset( $sizes[$name] ) && $sizes[$name] === $values ) {
746
  if ( $image_meta )
747
  $metadata['image_meta'] = $image_meta;
748
  }
749
+
750
  return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
751
  }
752
 
769
 
770
  if ( is_array( $sizes_custom ) ) {
771
  foreach( $sizes_custom as $key => $value ) {
772
+ if( isset( $value['s'] ) && $value['s'] == 1 ) {
773
+ $size_names[$key] = $this->_getThumbnailName( $key );;
774
+ }
775
  }
776
  }
777
  foreach ( $size_names as $size => $label ) {
817
 
818
  return $form_fields;
819
  }
820
+
821
+ /**
822
+ * Add the thumbnail name in the post insertion, based on new WP filter
823
+ *
824
+ * @access public
825
+ * @param array $sizes
826
+ * @return array
827
+ * @since 2.3
828
+ * @author Nicolas Juen
829
+ * @author radeno based on this post : http://www.wpmayor.com/wordpress-hacks/how-to-add-custom-image-sizes-to-wordpress-uploader/
830
+ */
831
+ function AddThumbnailName($sizes) {
832
+ // Get options
833
+ $sizes_custom = get_option( SIS_OPTION );
834
+ // init size array
835
+ $addsizes = array();
836
+
837
+ // check there is custom sizes
838
+ if ( is_array( $sizes_custom ) && !empty( $sizes_custom ) ) {
839
+ foreach( $sizes_custom as $key => $value ) {
840
+ // If we show this size in the admin
841
+ if( isset( $value['s'] ) && $value['s'] == 1 )
842
+ $addsizes[$key] = $this->_getThumbnailName( $key );
843
+ }
844
+ }
845
+
846
+ // Merge the two array
847
+ $newsizes = array_merge($sizes, $addsizes);
848
+
849
+ // Add new size
850
+ return $newsizes;
851
+ }
852
+
853
+ /**
854
+ * Get a thumbnail name from its slug
855
+ *
856
+ * @access private
857
+ * @param string $thumbnailSlug : the slug of the thumbnail
858
+ * @return array
859
+ * @since 2.3
860
+ * @author Nicolas Juen
861
+ */
862
+ private function _getThumbnailName( $thumbnailSlug = '' ) {
863
+
864
+ // get the options
865
+ $sizes_custom = get_option( SIS_OPTION );
866
+
867
+ // If the size exists
868
+ if( isset( $sizes_custom[$thumbnailSlug] ) ) {
869
+ // If the name exists return it, slug by default
870
+ if( isset( $sizes_custom[$thumbnailSlug]['n'] ) && !empty( $sizes_custom[$thumbnailSlug]['n'] ) ) {
871
+ return $sizes_custom[$thumbnailSlug]['n'];
872
+ } else {
873
+ return $thumbnailSlug;
874
+ }
875
+ }
876
+
877
+ // return slug if not found
878
+ return $thumbnailSlug;
879
+ }
880
  }
881
  ?>
js/sis.js CHANGED
@@ -301,6 +301,16 @@ var sizes = {
301
  ).val( "0" ).addClass( "h small-text" )
302
  ).appendTo( tdEl );
303
 
 
 
 
 
 
 
 
 
 
 
304
  els = jQuery( '<span />' )
305
  .addClass( 'size_options' )
306
  .append(
@@ -345,6 +355,7 @@ var sizes = {
345
  } )
346
  .text( sis.show )
347
  );
 
348
  els.appendTo(tdEl);
349
 
350
  jQuery( '<div />' ).text( sis.deleteImage ).addClass('delete_size').appendTo( tdEl );
@@ -406,6 +417,7 @@ var sizes = {
406
  var n = parent.find( 'input[name="image_name"]' ).val();
407
  var c = parent.find( 'label.c' ).hasClass( 'ui-state-active' );
408
  var s = parent.find( 'label.s' ).hasClass( 'ui-state-active' );
 
409
 
410
  if( c == false || c == undefined ) {
411
  c = false;
@@ -427,7 +439,7 @@ var sizes = {
427
  url: sis.ajaxUrl,
428
  type: "POST",
429
  dataType :'json',
430
- data: { action : "add_size", width: w, height: h, crop: c, name: n, show: s, nonce : wp_nonce },
431
  beforeSend: function() {
432
  // Remove status and set pending
433
  parent.removeClass();
@@ -597,16 +609,19 @@ var sizes = {
597
  var w_el = parent.find( 'input.w' );
598
  var c_el = parent.find( 'input.c' );
599
  var s_el = parent.find( 'input.s' );
 
600
 
601
  var h = h_el.val();
602
  var w = w_el.val();
603
  var c = parent.find( 'label.c' ).hasClass( 'ui-state-active' );
604
  var s = parent.find( 'label.s' ).hasClass( 'ui-state-active' );
 
605
 
606
  var base_h = h_el.attr( 'base_h' );
607
  var base_w = w_el.attr( 'base_w' );
608
  var base_c = c_el.attr( 'base_c' );
609
  var base_s = s_el.attr( 'base_s' );
 
610
 
611
  if( base_c == '0' )
612
  base_c = false;
@@ -620,7 +635,7 @@ var sizes = {
620
 
621
 
622
 
623
- if( h != base_h || w != base_w || c != base_c || s != base_s ) {
624
  el.closest( 'td' ).addClass( 'notSaved' ).find('.add_size').css( 'display', 'inline-block' );
625
  } else {
626
  el.closest( 'td' ).removeClass( 'notSaved' ).find('.add_size').css( 'display', 'none' );
@@ -642,7 +657,7 @@ jQuery(function() {
642
  jQuery('.delete_size').live( 'click', function( e ) { sizes.deleteSize( e, this ); } );
643
  jQuery('.add_size').live( 'click', function( e ) { sizes.ajaxRegister( e, this ); } );
644
 
645
- jQuery( '.h,.w,.c,.s' ).live( 'click', function( e ) { sizes.displayChange( this ); } );
646
 
647
  // Seup the getphp
648
  jQuery('#get_php').click( function( e ){ sizes.getPhp( e, this ) } );
301
  ).val( "0" ).addClass( "h small-text" )
302
  ).appendTo( tdEl );
303
 
304
+
305
+ jQuery( '<label />' ).attr( 'for', 'custom_image_sizes[' + name + '][n]' ).addClass( 'sis-label' ).text(sis.customName).append(
306
+ jQuery( '<input />' ).attr( { type: 'text',
307
+ name: 'custom_image_sizes[' + name + '][n]',
308
+ id: 'custom_image_sizes[' + name + '][n]',
309
+ base_n:name
310
+ }
311
+ ).val( name ).addClass( "n small-text" )
312
+ ).appendTo( tdEl );
313
+
314
  els = jQuery( '<span />' )
315
  .addClass( 'size_options' )
316
  .append(
355
  } )
356
  .text( sis.show )
357
  );
358
+
359
  els.appendTo(tdEl);
360
 
361
  jQuery( '<div />' ).text( sis.deleteImage ).addClass('delete_size').appendTo( tdEl );
417
  var n = parent.find( 'input[name="image_name"]' ).val();
418
  var c = parent.find( 'label.c' ).hasClass( 'ui-state-active' );
419
  var s = parent.find( 'label.s' ).hasClass( 'ui-state-active' );
420
+ var cn = parent.find( 'input.n' ).val();
421
 
422
  if( c == false || c == undefined ) {
423
  c = false;
439
  url: sis.ajaxUrl,
440
  type: "POST",
441
  dataType :'json',
442
+ data: { action : "add_size", width: w, height: h, crop: c, name: n, show: s, customName : cn , nonce : wp_nonce },
443
  beforeSend: function() {
444
  // Remove status and set pending
445
  parent.removeClass();
609
  var w_el = parent.find( 'input.w' );
610
  var c_el = parent.find( 'input.c' );
611
  var s_el = parent.find( 'input.s' );
612
+ var n_el = parent.find( 'input.n' );
613
 
614
  var h = h_el.val();
615
  var w = w_el.val();
616
  var c = parent.find( 'label.c' ).hasClass( 'ui-state-active' );
617
  var s = parent.find( 'label.s' ).hasClass( 'ui-state-active' );
618
+ var n = n_el.val();
619
 
620
  var base_h = h_el.attr( 'base_h' );
621
  var base_w = w_el.attr( 'base_w' );
622
  var base_c = c_el.attr( 'base_c' );
623
  var base_s = s_el.attr( 'base_s' );
624
+ var base_n = n_el.attr( 'base_n' );
625
 
626
  if( base_c == '0' )
627
  base_c = false;
635
 
636
 
637
 
638
+ if( h != base_h || w != base_w || c != base_c || s != base_s || n != base_n ) {
639
  el.closest( 'td' ).addClass( 'notSaved' ).find('.add_size').css( 'display', 'inline-block' );
640
  } else {
641
  el.closest( 'td' ).removeClass( 'notSaved' ).find('.add_size').css( 'display', 'none' );
657
  jQuery('.delete_size').live( 'click', function( e ) { sizes.deleteSize( e, this ); } );
658
  jQuery('.add_size').live( 'click', function( e ) { sizes.ajaxRegister( e, this ); } );
659
 
660
+ jQuery( '.h,.w,.c,.s,.n' ).live( 'click skeyup change', function( e ) { sizes.displayChange( this ); } );
661
 
662
  // Seup the getphp
663
  jQuery('#get_php').click( function( e ){ sizes.getPhp( e, this ) } );
js/sis.min.js CHANGED
@@ -1,24 +1,25 @@
1
  sis_small=!0;
2
- var regenerate={post_types:"",thumbnails:"",list:"",cur:0,timeScript:[],dateScript:"",percent:"",getThumbnails:function(){var a=this,b=jQuery("input.thumbnails:checked");b.length!=jQuery('input.thumbnails[type="checkbox"]').length&&b.each(function(){a.thumbnails+="&thumbnails[]="+jQuery(this).val()})},getPostTypes:function(){var a=this,b=jQuery("input.post_types:checked");b.length!=jQuery('input.post_types[type="checkbox"]').length&&b.each(function(){a.post_types+="&post_types[]="+jQuery(this).val()})},setMessage:function(a){jQuery("#regenerate_message").html("<p>"+
3
- a+"</p>").addClass("updated").addClass("fade").show();this.refreshProgressBar()},setTimeMessage:function(a){jQuery("#time p span.time_message").html(a)},refreshProgressBar:function(){jQuery(".progress").progressbar()},checkStartRegenerating:function(){if(0<jQuery(".notSaved").size())if(!0==confirm(sis.notSaved))this.startRegenerating();else return!1;else this.startRegenerating()},startRegenerating:function(){var a=this,b=jQuery("input.getList").val();this.dateScript=new Date;jQuery.ajax({url:sis.ajaxUrl,
4
- type:"POST",dataType:"json",data:"action=sis_ajax_thumbnail_rebuild&do=getlist"+a.post_types+"&nonce="+b,beforeSend:function(){jQuery("#ajax_thumbnail_rebuild").attr("disabled",!0);a.setMessage(sis.reading);a.getThumbnails();a.getPostTypes()},success:function(c){if("object"!==typeof c)return a.reInit(),a.setMessage(sis.phpError),!1;jQuery("#time").show();a.list=c;a.curr=0;jQuery(".progress").show();a.regenItem()}})},regenItem:function(){var a=this,b=jQuery("input.regen").val();if(!this.list)return this.reInit(),
5
- this.setMessage(sis.noMedia),!1;this.curr>=this.list.length?(b=new Date,this.reInit(),this.setMessage(sis.done+this.curr+" "+sis.messageRegenerated+sis.startedAt+" "+b.getHours()+":"+b.getMinutes()+":"+b.getSeconds()+sis.finishedAt+" "+b.getHours()+":"+b.getMinutes()+":"+b.getSeconds())):(this.setMessage(sis.regenerating+(this.curr+1)+sis.of+this.list.length+" ("+this.list[this.curr].title+")..."),jQuery.ajax({url:sis.ajaxUrl,type:"POST",dataType:"json",data:"action=sis_ajax_thumbnail_rebuild&do=regen&id="+
6
- this.list[this.curr].id+this.thumbnails+"&nonce="+b,beforeSend:function(){a.percent=100*(a.curr/a.list.length);jQuery(".progress").progressbar("value",a.percent);jQuery(".progress-percent span.text").html(Math.round(a.percent)+"%").closest(".progress-percent").animate({left:Math.round(a.percent)-2.5+"%"},500)},success:function(c){if(!c.src||!c.time||c.error||"object"!==typeof c){var b="",b="object"!==typeof c?sis.phpError:c.error;jQuery("#error_messages").addClass("error message");jQuery("#error_messages ul.messages").prepend("<li>"+
7
- b+"</li>")}else{c.message&&jQuery("#time ul.messages").prepend("<li>"+c.message+"</li>");var b=new Date,g=new Date;jQuery("#thumb").show();jQuery("#thumb-img").attr("src",c.src);a.timeScript.push(c.time);for(var c=a.timeScript.length,e=0,d=0;d<c;d++)e+=a.timeScript[d];c=Math.round(1E3*e/c*a.list.length);b.setTime(a.dateScript.getTime()+c);g=a.s2t((b.getTime()-g.getTime())/1E3);a.setTimeMessage(b.getHours()+":"+b.getMinutes()+":"+b.getSeconds()+sis.or+g+sis.beforeEnd)}a.curr++;a.regenItem()}}))},s2t:function(a){var a=
8
- a%86400,b=new Date(1970,0,1);b.setSeconds(a);var c=b.toTimeString().substr(0,8);86399<a&&(c=Math.floor((b-Date.parse("1/1/70"))/36E5)+c.substr(2));return c},reInit:function(){jQuery("#ajax_thumbnail_rebuild").removeAttr("disabled");jQuery(".progress, #thumb").hide()}},sizes={i:0,add:function(a,b){a.preventDefault();var c=jQuery("<tr />").attr("valign","top").addClass("new_size_"+this.i+" new_size");jQuery("<th />").attr("scope","row").append(jQuery("<input />").attr({type:"text",id:"new_size_"+this.i}).val("thumbnail-name")).appendTo(c);
9
- jQuery("<td />").append(jQuery("<input />").attr({type:"button",id:"validate_"+this.i}).val(sis.validate).addClass("button-secondary action add_size_name")).appendTo(c);jQuery(b).closest("tr").before(c);this.i++},register:function(a,b){a.preventDefault();var c=jQuery(b).closest("tr").children("th").find("input").val(),f=jQuery(b).closest("tr").children("th").find("input").attr("id"),g=jQuery(b).closest("tbody").find('input[value="'+c+'"]').length;if("thumbnail"==c||"medium"==c||"large"==c)return alert(sis.notOriginal),
10
- !1;if(0!=g)return alert(sis.alreadyPresent),!1;var g=jQuery("<th />").attr("scope","row").text(sis.size+" "+c),e=jQuery("<td />");jQuery("<input />").attr({type:"hidden",name:"image_name"}).val(c).appendTo(e);jQuery("<input />").attr({type:"hidden",name:"custom_image_sizes["+c+"][custom]"}).val("1").appendTo(e);jQuery("<label />").attr("for","custom_image_sizes["+c+"][w]").addClass("sis-label").text(sis.maximumWidth).append(jQuery("<input />").attr({type:"number",name:"custom_image_sizes["+c+"][w]",
11
- step:1,min:0,id:"custom_image_sizes["+c+"][w]",base_w:0}).val("0").addClass("w small-text")).appendTo(e);jQuery("<label />").attr("for","custom_image_sizes["+c+"][h]").addClass("sis-label").text(sis.maximumHeight).append(jQuery("<input />").attr({type:"number",name:"custom_image_sizes["+c+"][h]",step:1,min:0,id:"custom_image_sizes["+c+"][h]",base_h:0}).val("0").addClass("h small-text")).appendTo(e);els=jQuery("<span />").addClass("size_options").append(jQuery("<input />").attr({type:"checkbox",name:"custom_image_sizes["+
12
- c+"][c]",id:"custom_image_sizes["+c+"][c]",base_c:0}).val("1").addClass("c crop")).append(jQuery("<label />").attr({"for":"custom_image_sizes["+c+"][c]",id:"custom_image_sizes["+c+"][c]","class":"c",title:sis.crop}).text(sis.crop)).append(jQuery("<input />").attr({type:"checkbox",name:"custom_image_sizes["+c+"][s]",id:"custom_image_sizes["+c+"][s]",base_s:0}).val("1").addClass("s show")).append(jQuery("<label />").attr({"for":"custom_image_sizes["+c+"][s]",id:"custom_image_sizes["+c+"][s]","class":"s",
13
- title:sis.show}).text(sis.show));els.appendTo(e);jQuery("<div />").text(sis.deleteImage).addClass("delete_size").appendTo(e);jQuery("<div />").text(sis.validateButton).addClass("add_size validate_size").appendTo(e);jQuery("#"+f).closest("tr").html(g.after(e));!0==sis_small?this.setButtonsSmall():this.setButtons()},deleteSize:function(a,b){a.preventDefault();!0==confirm(sis.confirmDelete)&&(jQuery(b).closest("tr").remove(),this.ajaxUnregister(b))},getPhp:function(a,b){a.preventDefault();var c=jQuery(b).closest("tr");
14
- jQuery.ajax({url:sis.ajaxUrl,type:"POST",data:{action:"get_sizes"},beforeSend:function(){c.removeClass("addPending");c.addClass("addPending")},success:function(a){jQuery("#get_php").nextAll("code").html("<br />"+a).show().css({display:"block"});c.removeClass("addPending")}})},ajaxRegister:function(a,b){a.preventDefault();var c=this,f=jQuery(b).closest("table"),g,e=jQuery(".addSize").val(),d=jQuery(b).closest("tr"),i=d.find('input[name="image_name"]').val(),h=d.find("label.c").hasClass("ui-state-active"),
15
- j=d.find("label.s").hasClass("ui-state-active"),h=!1==h||void 0==h?!1:!0,j=!1==j||void 0==j?!1:!0,k=parseInt(d.find("input.w").val()),l=parseInt(d.find("input.h").val());f.hasClass("ajaxing")||jQuery.ajax({url:sis.ajaxUrl,type:"POST",dataType:"json",data:{action:"add_size",width:k,height:l,crop:h,name:i,show:j,nonce:e},beforeSend:function(){d.removeClass();d.addClass("addPending");f.addClass("ajaxing")},success:function(a){var b="";d.removeClass();f.removeClass("ajaxing");0==a?b="errorAdding":(b=
16
- 2==a?"notChangedAdding":"successAdding",c.addToArray(i,k,l,h,b));d.find("input.h").attr({base_h:l});d.find("input.w").attr({base_w:k});d.find("input.c").attr({base_c:h});d.find("input.s").attr({base_s:j});d.addClass(b);d.find("td").removeClass("notSaved");d.find(".add_size").removeClass("validate_size").hide().children(".ui-button-text").text(sis.update);clearTimeout(g);g=setTimeout(function(){d.removeClass("errorAdding notChangedAdding successAdding")},3E3)}})},ajaxUnregister:function(a){var b=this,
17
- c=jQuery(a).closest("tr").find('input[name="image_name"]').val(),f=jQuery(a).closest("tr").find("input.deleteSize").val();jQuery.ajax({url:sis.ajaxUrl,type:"POST",data:{action:"remove_size",name:c,nonce:f},success:function(){b.removeFromArray(a)}})},addToArray:function(a,b,c,f,g){var e=jQuery('#sis-regen .wrapper > table#sis_sizes > tbody input[value="'+a+'"]'),d="",i,d=0!=e.length?e.closest("tr"):jQuery("#sis-regen .wrapper > table#sis_sizes > tbody > tr:first").clone(),f=!0==f?sis.tr:sis.fl;d.find("th > label").attr("for",
18
- a).end().find("input.thumbnails").val(a).attr("id",a).end().find("th:nth-child(2) > label").text(a).end().find("th:nth-child(3) > label").text(b+"px").end().find("th:nth-child(4) > label").text(c+"px").end().find("th:nth-child(5) > label").text(f);0==e.length&&d.appendTo("#sis-regen .wrapper > table#sis_sizes > tbody");d.removeClass("errorAdding notChangedAdding successAdding").addClass(g);clearTimeout(i);i=setTimeout(function(){d.removeClass("errorAdding notChangedAdding successAdding")},3E3)},removeFromArray:function(a){a=
19
- jQuery(a).closest("tr").find("input[name=image_name]").val();jQuery('#sis-regen .wrapper > table#sis_sizes > tbody input[value="'+a+'"]').closest("tr").remove()},setButtons:function(){jQuery(".delete_size").button({icons:{primary:"ui-icon-circle-close"},text:!0});jQuery(".add_size").button({icons:{primary:"ui-icon-check"},text:!0});jQuery(".crop").button({icons:{primary:"ui-icon-arrow-4-diag"},text:!0});jQuery(".show").button({icons:{primary:"ui-icon-lightbulb"},text:!0});jQuery(".size_options").buttonset()},
20
- setButtonsSmall:function(){jQuery(".delete_size").button({icons:{primary:"ui-icon-circle-close"},text:!1});jQuery(".add_size").button({icons:{primary:"ui-icon-check"},text:!1});jQuery(".crop").button({icons:{primary:"ui-icon-arrow-4-diag"},text:!1});jQuery(".show").button({icons:{primary:"ui-icon-lightbulb"},text:!1})},displayChange:function(a){var a=jQuery(a),b=a.closest("tr");if(b.hasClass("new_size"))return!1;var c=b.find("input.h"),f=b.find("input.w"),g=b.find("input.c"),e=b.find("input.s"),d=
21
- c.val(),i=f.val(),h=b.find("label.c").hasClass("ui-state-active"),b=b.find("label.s").hasClass("ui-state-active"),c=c.attr("base_h"),f=f.attr("base_w"),g=g.attr("base_c"),e=e.attr("base_s");d!=c||i!=f||h!=("0"==g?!1:!0)||b!=("0"==e?!1:!0)?a.closest("td").addClass("notSaved").find(".add_size").css("display","inline-block"):a.closest("td").removeClass("notSaved").find(".add_size").css("display","none")}};
22
- jQuery(function(){jQuery("#ajax_thumbnail_rebuild").click(function(){regenerate.checkStartRegenerating()});jQuery("#add_size").click(function(a){sizes.add(a,this)});jQuery(".add_size_name").live("click",function(a){sizes.register(a,this)});jQuery(".delete_size").live("click",function(a){sizes.deleteSize(a,this)});jQuery(".add_size").live("click",function(a){sizes.ajaxRegister(a,this)});jQuery(".h,.w,.c,.s").live("click",function(){sizes.displayChange(this)});jQuery("#get_php").click(function(a){sizes.getPhp(a,
 
23
  this)});jQuery("#get_php").nextAll("code").hide();jQuery("span.custom_size").closest("tr").children("th").css({color:"#89D76A"});jQuery("span.theme_size").closest("tr").children("th").css({color:"#F2A13A"});jQuery(".add_size").hide();jQuery('<div class="ui-widget" id="msg"><div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"><p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span><strong>Alert:</strong> <ul class="msg" ></ul></p></div></div>').prependTo("div#wpwrap").slideUp(0);
24
- jQuery("#msg").ajaxError(function(a,b,c){jQuery(this).find(".msg").append("<li>"+sis.ajaxErrorHandler+" "+c.url+", status "+b.status+" : "+b.statusText+"</li>").end().stop(!1,!1).slideDown(200).delay(5E3).slideUp(200)});jQuery(window).bind("resize",function(){820>=window.innerWidth&&!1==sis_small?(sizes.setButtonsSmall(),sis_small=!0):820<window.innerWidth&&!0==sis_small&&(sizes.setButtons(),sis_small=!1)});sizes.setButtons()});
1
  sis_small=!0;
2
+ var regenerate={post_types:"",thumbnails:"",list:"",cur:0,timeScript:[],dateScript:"",percent:"",getThumbnails:function(){var a=this,c=jQuery("input.thumbnails:checked");c.length!=jQuery('input.thumbnails[type="checkbox"]').length&&c.each(function(){a.thumbnails+="&thumbnails[]="+jQuery(this).val()})},getPostTypes:function(){var a=this,c=jQuery("input.post_types:checked");c.length!=jQuery('input.post_types[type="checkbox"]').length&&c.each(function(){a.post_types+="&post_types[]="+jQuery(this).val()})},setMessage:function(a){jQuery("#regenerate_message").html("<p>"+
3
+ a+"</p>").addClass("updated").addClass("fade").show();this.refreshProgressBar()},setTimeMessage:function(a){jQuery("#time p span.time_message").html(a)},refreshProgressBar:function(){jQuery(".progress").progressbar()},checkStartRegenerating:function(){if(0<jQuery(".notSaved").size())if(!0==confirm(sis.notSaved))this.startRegenerating();else return!1;else this.startRegenerating()},startRegenerating:function(){var a=this,c=jQuery("input.getList").val();this.dateScript=new Date;jQuery.ajax({url:sis.ajaxUrl,
4
+ type:"POST",dataType:"json",data:"action=sis_ajax_thumbnail_rebuild&do=getlist"+a.post_types+"&nonce="+c,beforeSend:function(){jQuery("#ajax_thumbnail_rebuild").attr("disabled",!0);a.setMessage(sis.reading);a.getThumbnails();a.getPostTypes()},success:function(b){if("object"!==typeof b)return a.reInit(),a.setMessage(sis.phpError),!1;jQuery("#time").show();a.list=b;a.curr=0;jQuery(".progress").show();a.regenItem()}})},regenItem:function(){var a=this,c=jQuery("input.regen").val();if(!this.list)return this.reInit(),
5
+ this.setMessage(sis.noMedia),!1;this.curr>=this.list.length?(c=new Date,this.reInit(),this.setMessage(sis.done+this.curr+" "+sis.messageRegenerated+sis.startedAt+" "+c.getHours()+":"+c.getMinutes()+":"+c.getSeconds()+sis.finishedAt+" "+c.getHours()+":"+c.getMinutes()+":"+c.getSeconds())):(this.setMessage(sis.regenerating+(this.curr+1)+sis.of+this.list.length+" ("+this.list[this.curr].title+")..."),jQuery.ajax({url:sis.ajaxUrl,type:"POST",dataType:"json",data:"action=sis_ajax_thumbnail_rebuild&do=regen&id="+
6
+ this.list[this.curr].id+this.thumbnails+"&nonce="+c,beforeSend:function(){a.percent=100*(a.curr/a.list.length);jQuery(".progress").progressbar("value",a.percent);jQuery(".progress-percent span.text").html(Math.round(a.percent)+"%").closest(".progress-percent").animate({left:Math.round(a.percent)-2.5+"%"},500)},success:function(b){if(!b.src||!b.time||b.error||"object"!==typeof b){var c="",c="object"!==typeof b?sis.phpError:b.error;jQuery("#error_messages").addClass("error message");jQuery("#error_messages ul.messages").prepend("<li>"+
7
+ c+"</li>")}else{b.message&&jQuery("#time ul.messages").prepend("<li>"+b.message+"</li>");var c=new Date,g=new Date;jQuery("#thumb").show();jQuery("#thumb-img").attr("src",b.src);a.timeScript.push(b.time);for(var b=a.timeScript.length,e=0,d=0;d<b;d++)e+=a.timeScript[d];b=Math.round(1E3*e/b*a.list.length);c.setTime(a.dateScript.getTime()+b);g=a.s2t((c.getTime()-g.getTime())/1E3);a.setTimeMessage(c.getHours()+":"+c.getMinutes()+":"+c.getSeconds()+sis.or+g+sis.beforeEnd)}a.curr++;a.regenItem()}}))},s2t:function(a){var a=
8
+ a%86400,c=new Date(1970,0,1);c.setSeconds(a);var b=c.toTimeString().substr(0,8);86399<a&&(b=Math.floor((c-Date.parse("1/1/70"))/36E5)+b.substr(2));return b},reInit:function(){jQuery("#ajax_thumbnail_rebuild").removeAttr("disabled");jQuery(".progress, #thumb").hide()}},sizes={i:0,add:function(a,c){a.preventDefault();var b=jQuery("<tr />").attr("valign","top").addClass("new_size_"+this.i+" new_size");jQuery("<th />").attr("scope","row").append(jQuery("<input />").attr({type:"text",id:"new_size_"+this.i}).val("thumbnail-name")).appendTo(b);
9
+ jQuery("<td />").append(jQuery("<input />").attr({type:"button",id:"validate_"+this.i}).val(sis.validate).addClass("button-secondary action add_size_name")).appendTo(b);jQuery(c).closest("tr").before(b);this.i++},register:function(a,c){a.preventDefault();var b=jQuery(c).closest("tr").children("th").find("input").val(),f=jQuery(c).closest("tr").children("th").find("input").attr("id"),g=jQuery(c).closest("tbody").find('input[value="'+b+'"]').length;if("thumbnail"==b||"medium"==b||"large"==b)return alert(sis.notOriginal),
10
+ !1;if(0!=g)return alert(sis.alreadyPresent),!1;var g=jQuery("<th />").attr("scope","row").text(sis.size+" "+b),e=jQuery("<td />");jQuery("<input />").attr({type:"hidden",name:"image_name"}).val(b).appendTo(e);jQuery("<input />").attr({type:"hidden",name:"custom_image_sizes["+b+"][custom]"}).val("1").appendTo(e);jQuery("<label />").attr("for","custom_image_sizes["+b+"][w]").addClass("sis-label").text(sis.maximumWidth).append(jQuery("<input />").attr({type:"number",name:"custom_image_sizes["+b+"][w]",
11
+ step:1,min:0,id:"custom_image_sizes["+b+"][w]",base_w:0}).val("0").addClass("w small-text")).appendTo(e);jQuery("<label />").attr("for","custom_image_sizes["+b+"][h]").addClass("sis-label").text(sis.maximumHeight).append(jQuery("<input />").attr({type:"number",name:"custom_image_sizes["+b+"][h]",step:1,min:0,id:"custom_image_sizes["+b+"][h]",base_h:0}).val("0").addClass("h small-text")).appendTo(e);jQuery("<label />").attr("for","custom_image_sizes["+b+"][n]").addClass("sis-label").text(sis.customName).append(jQuery("<input />").attr({type:"text",
12
+ name:"custom_image_sizes["+b+"][n]",id:"custom_image_sizes["+b+"][n]",base_n:b}).val(b).addClass("n small-text")).appendTo(e);els=jQuery("<span />").addClass("size_options").append(jQuery("<input />").attr({type:"checkbox",name:"custom_image_sizes["+b+"][c]",id:"custom_image_sizes["+b+"][c]",base_c:0}).val("1").addClass("c crop")).append(jQuery("<label />").attr({"for":"custom_image_sizes["+b+"][c]",id:"custom_image_sizes["+b+"][c]","class":"c",title:sis.crop}).text(sis.crop)).append(jQuery("<input />").attr({type:"checkbox",
13
+ name:"custom_image_sizes["+b+"][s]",id:"custom_image_sizes["+b+"][s]",base_s:0}).val("1").addClass("s show")).append(jQuery("<label />").attr({"for":"custom_image_sizes["+b+"][s]",id:"custom_image_sizes["+b+"][s]","class":"s",title:sis.show}).text(sis.show));els.appendTo(e);jQuery("<div />").text(sis.deleteImage).addClass("delete_size").appendTo(e);jQuery("<div />").text(sis.validateButton).addClass("add_size validate_size").appendTo(e);jQuery("#"+f).closest("tr").html(g.after(e));!0==sis_small?this.setButtonsSmall():
14
+ this.setButtons()},deleteSize:function(a,c){a.preventDefault();!0==confirm(sis.confirmDelete)&&(jQuery(c).closest("tr").remove(),this.ajaxUnregister(c))},getPhp:function(a,c){a.preventDefault();var b=jQuery(c).closest("tr");jQuery.ajax({url:sis.ajaxUrl,type:"POST",data:{action:"get_sizes"},beforeSend:function(){b.removeClass("addPending");b.addClass("addPending")},success:function(a){jQuery("#get_php").nextAll("code").html("<br />"+a).show().css({display:"block"});b.removeClass("addPending")}})},
15
+ ajaxRegister:function(a,c){a.preventDefault();var b=this,f=jQuery(c).closest("table"),g,e=jQuery(".addSize").val(),d=jQuery(c).closest("tr"),i=d.find('input[name="image_name"]').val(),h=d.find("label.c").hasClass("ui-state-active"),j=d.find("label.s").hasClass("ui-state-active"),k=d.find("input.n").val(),h=!1==h||void 0==h?!1:!0,j=!1==j||void 0==j?!1:!0,l=parseInt(d.find("input.w").val()),m=parseInt(d.find("input.h").val());f.hasClass("ajaxing")||jQuery.ajax({url:sis.ajaxUrl,type:"POST",dataType:"json",
16
+ data:{action:"add_size",width:l,height:m,crop:h,name:i,show:j,customName:k,nonce:e},beforeSend:function(){d.removeClass();d.addClass("addPending");f.addClass("ajaxing")},success:function(a){var c="";d.removeClass();f.removeClass("ajaxing");0==a?c="errorAdding":(c=2==a?"notChangedAdding":"successAdding",b.addToArray(i,l,m,h,c));d.find("input.h").attr({base_h:m});d.find("input.w").attr({base_w:l});d.find("input.c").attr({base_c:h});d.find("input.s").attr({base_s:j});d.addClass(c);d.find("td").removeClass("notSaved");
17
+ d.find(".add_size").removeClass("validate_size").hide().children(".ui-button-text").text(sis.update);clearTimeout(g);g=setTimeout(function(){d.removeClass("errorAdding notChangedAdding successAdding")},3E3)}})},ajaxUnregister:function(a){var c=this,b=jQuery(a).closest("tr").find('input[name="image_name"]').val(),f=jQuery(a).closest("tr").find("input.deleteSize").val();jQuery.ajax({url:sis.ajaxUrl,type:"POST",data:{action:"remove_size",name:b,nonce:f},success:function(){c.removeFromArray(a)}})},addToArray:function(a,
18
+ c,b,f,g){var e=jQuery('#sis-regen .wrapper > table#sis_sizes > tbody input[value="'+a+'"]'),d="",i,d=0!=e.length?e.closest("tr"):jQuery("#sis-regen .wrapper > table#sis_sizes > tbody > tr:first").clone(),f=!0==f?sis.tr:sis.fl;d.find("th > label").attr("for",a).end().find("input.thumbnails").val(a).attr("id",a).end().find("th:nth-child(2) > label").text(a).end().find("th:nth-child(3) > label").text(c+"px").end().find("th:nth-child(4) > label").text(b+"px").end().find("th:nth-child(5) > label").text(f);
19
+ 0==e.length&&d.appendTo("#sis-regen .wrapper > table#sis_sizes > tbody");d.removeClass("errorAdding notChangedAdding successAdding").addClass(g);clearTimeout(i);i=setTimeout(function(){d.removeClass("errorAdding notChangedAdding successAdding")},3E3)},removeFromArray:function(a){a=jQuery(a).closest("tr").find("input[name=image_name]").val();jQuery('#sis-regen .wrapper > table#sis_sizes > tbody input[value="'+a+'"]').closest("tr").remove()},setButtons:function(){jQuery(".delete_size").button({icons:{primary:"ui-icon-circle-close"},
20
+ text:!0});jQuery(".add_size").button({icons:{primary:"ui-icon-check"},text:!0});jQuery(".crop").button({icons:{primary:"ui-icon-arrow-4-diag"},text:!0});jQuery(".show").button({icons:{primary:"ui-icon-lightbulb"},text:!0});jQuery(".size_options").buttonset()},setButtonsSmall:function(){jQuery(".delete_size").button({icons:{primary:"ui-icon-circle-close"},text:!1});jQuery(".add_size").button({icons:{primary:"ui-icon-check"},text:!1});jQuery(".crop").button({icons:{primary:"ui-icon-arrow-4-diag"},text:!1});
21
+ jQuery(".show").button({icons:{primary:"ui-icon-lightbulb"},text:!1})},displayChange:function(a){var a=jQuery(a),c=a.closest("tr");if(c.hasClass("new_size"))return!1;var b=c.find("input.h"),f=c.find("input.w"),g=c.find("input.c"),e=c.find("input.s"),d=c.find("input.n"),i=b.val(),h=f.val(),j=c.find("label.c").hasClass("ui-state-active"),c=c.find("label.s").hasClass("ui-state-active"),k=d.val(),b=b.attr("base_h"),f=f.attr("base_w"),g=g.attr("base_c"),e=e.attr("base_s"),d=d.attr("base_n");i!=b||h!=f||
22
+ j!=("0"==g?!1:!0)||c!=("0"==e?!1:!0)||k!=d?a.closest("td").addClass("notSaved").find(".add_size").css("display","inline-block"):a.closest("td").removeClass("notSaved").find(".add_size").css("display","none")}};
23
+ jQuery(function(){jQuery("#ajax_thumbnail_rebuild").click(function(){regenerate.checkStartRegenerating()});jQuery("#add_size").click(function(a){sizes.add(a,this)});jQuery(".add_size_name").live("click",function(a){sizes.register(a,this)});jQuery(".delete_size").live("click",function(a){sizes.deleteSize(a,this)});jQuery(".add_size").live("click",function(a){sizes.ajaxRegister(a,this)});jQuery(".h,.w,.c,.s,.n").live("click skeyup change",function(){sizes.displayChange(this)});jQuery("#get_php").click(function(a){sizes.getPhp(a,
24
  this)});jQuery("#get_php").nextAll("code").hide();jQuery("span.custom_size").closest("tr").children("th").css({color:"#89D76A"});jQuery("span.theme_size").closest("tr").children("th").css({color:"#F2A13A"});jQuery(".add_size").hide();jQuery('<div class="ui-widget" id="msg"><div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"><p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span><strong>Alert:</strong> <ul class="msg" ></ul></p></div></div>').prependTo("div#wpwrap").slideUp(0);
25
+ jQuery("#msg").ajaxError(function(a,c,b){jQuery(this).find(".msg").append("<li>"+sis.ajaxErrorHandler+" "+b.url+", status "+c.status+" : "+c.statusText+"</li>").end().stop(!1,!1).slideDown(200).delay(5E3).slideUp(200)});jQuery(window).bind("resize",function(){820>=window.innerWidth&&!1==sis_small?(sizes.setButtonsSmall(),sis_small=!0):820<window.innerWidth&&!0==sis_small&&(sizes.setButtons(),sis_small=!1)});sizes.setButtons()});
languages/sis-fr_FR.mo CHANGED
Binary file
languages/sis-fr_FR.po CHANGED
@@ -1,252 +1,257 @@
1
- # Copyright (C) 2010
2
- # This file is distributed under the same license as the package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Simple image sizes\n"
6
- "Report-Msgid-Bugs-To: \n"
7
- "POT-Creation-Date: 2011-12-19 23:02+0100\n"
8
- "PO-Revision-Date: 2011-12-19 23:04+0100\n"
9
- "Last-Translator: \n"
10
- "Language-Team: Beapi <njuen@beapi.fr>\n"
11
- "MIME-Version: 1.0\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
- "Content-Transfer-Encoding: 8bit\n"
14
- "X-Poedit-Language: French\n"
15
- "X-Poedit-Country: FRANCE\n"
16
- "X-Poedit-SourceCharset: utf-8\n"
17
- "X-Poedit-KeywordsList: __;_e;__\n"
18
- "X-Poedit-Basepath: ../\n"
19
- "X-Poedit-SearchPath-0: .\n"
20
-
21
- #: inc/class.admin.php:69
22
- msgid "Reading attachments..."
23
- msgstr "Chargement des médias..."
24
-
25
- #: inc/class.admin.php:70
26
- #: inc/class.admin.php:229
27
- msgid "Maximum width"
28
- msgstr "Largeur maximum"
29
-
30
- #: inc/class.admin.php:71
31
- #: inc/class.admin.php:233
32
- msgid "Maximum height"
33
- msgstr "Hauteur maximum"
34
-
35
- #: inc/class.admin.php:72
36
- #: inc/class.admin.php:238
37
- #: inc/class.admin.php:311
38
- #: inc/class.admin.php:370
39
- msgid "Crop ?"
40
- msgstr "Rogner ?"
41
-
42
- #: inc/class.admin.php:73
43
- #: inc/class.admin.php:358
44
- msgid "yes"
45
- msgstr "oui"
46
-
47
- #: inc/class.admin.php:74
48
- #: inc/class.admin.php:358
49
- msgid "no"
50
- msgstr "non"
51
-
52
- #: inc/class.admin.php:75
53
- #: inc/class.admin.php:241
54
- msgid "Show in post insertion ?"
55
- msgstr "Afficher dans l'insertion ?"
56
-
57
- #: inc/class.admin.php:76
58
- msgid " of "
59
- msgstr " de "
60
-
61
- #: inc/class.admin.php:77
62
- msgid " or "
63
- msgstr " ou "
64
-
65
- #: inc/class.admin.php:78
66
- msgid " before the end."
67
- msgstr " avant la fin."
68
-
69
- #: inc/class.admin.php:79
70
- #: inc/class.admin.php:243
71
- msgid "Delete"
72
- msgstr "Supprimer"
73
-
74
- #: inc/class.admin.php:80
75
- msgid "No media in your site to regenerate !"
76
- msgstr "Pas de médias à regénérer !"
77
-
78
- #: inc/class.admin.php:81
79
- msgid "Regenerating "
80
- msgstr "Regénération "
81
-
82
- #: inc/class.admin.php:82
83
- msgid "Validate image size name"
84
- msgstr "Valider le nom de la taille d'image"
85
-
86
- #: inc/class.admin.php:83
87
- msgid "Done."
88
- msgstr "Fini."
89
-
90
- #: inc/class.admin.php:84
91
- msgid "Size"
92
- msgstr "Taille "
93
-
94
- #: inc/class.admin.php:85
95
- msgid "Don't use the basic Wordpress thumbnail size name, use the form above to edit them"
96
- msgstr "N'utilisez pas les tailles par défaut de WordPress comme nom de taille, éditez leurs valeurs avec le formulaire ci-dessus."
97
-
98
- #: inc/class.admin.php:86
99
- msgid "This size is already registered, edit it instead of recreating it."
100
- msgstr "Cette taille existe déjà, éditez la au lieu de la recréer."
101
-
102
- #: inc/class.admin.php:87
103
- msgid "Do you really want to delete these size ?"
104
- msgstr "Voulez-vous réellement supprimer cette taille ?"
105
-
106
- #: inc/class.admin.php:88
107
- #: inc/class.admin.php:244
108
- msgid "Update"
109
- msgstr "Mettre à jour"
110
-
111
- #: inc/class.admin.php:89
112
- msgid "Error requesting page"
113
- msgstr "Erreur lors de la requête vers la page"
114
-
115
- #: inc/class.admin.php:90
116
- msgid "images have been regenerated !"
117
- msgstr "images ont été regénérées !"
118
-
119
- #: inc/class.admin.php:91
120
- msgid "Validate"
121
- msgstr "Valider"
122
-
123
- #: inc/class.admin.php:92
124
- msgid " started at"
125
- msgstr " commencé à "
126
-
127
- #: inc/class.admin.php:93
128
- msgid " finished at :"
129
- msgstr " terminé à :"
130
-
131
- #: inc/class.admin.php:94
132
- msgid "Error during the php treatment, be sure to not have php errors in your page"
133
- msgstr "Erreur durant le traitement, soyez sûr de ne pas avoir d'erreurs php dans votre page"
134
-
135
- #: inc/class.admin.php:95
136
- msgid "All the sizes you have modifed are not saved, continue anyway ?"
137
- msgstr "Toutes les tailles qui ont été modifiée n'ont pas été sauvées, continuer tout de même ?"
138
-
139
- #: inc/class.admin.php:96
140
- #, php-format
141
- msgid "This image has been regenerated in %s seconds"
142
- msgstr "Cette image a été regénérée en %s secondes"
143
-
144
- #: inc/class.admin.php:111
145
- msgid "Regenerate thumbnails"
146
- msgstr "Régénérer les vignettes"
147
-
148
- #: inc/class.admin.php:131
149
- msgid "Settings"
150
- msgstr "Paramètres"
151
-
152
- #: inc/class.admin.php:180
153
- #, php-format
154
- msgid "%s size"
155
- msgstr "Taille %s"
156
-
157
- #: inc/class.admin.php:187
158
- msgid "Add a new size"
159
- msgstr "Ajouter une nouvelle taille"
160
-
161
- #: inc/class.admin.php:190
162
- msgid "Legend of the sizes"
163
- msgstr "Légende des tailles"
164
-
165
- #: inc/class.admin.php:193
166
- msgid "Get php for theme"
167
- msgstr "Récupérer le PHP pour le thème"
168
-
169
- #: inc/class.admin.php:196
170
- msgid "Thumbnail regeneration"
171
- msgstr "Régénération des vignettes"
172
-
173
- #: inc/class.admin.php:270
174
- msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
175
- msgstr "Copiez et collez le code ci-dessous dans votre fichier de fonctions de votre thème WordPress si vous voulez les conserver et désactiver ce plugin."
176
-
177
- #: inc/class.admin.php:283
178
- msgid "The images created on your theme are <span style=\"color:#F2A13A\">orange</span> and your custom size are <span style=\"color:#89D76A\"> green </span>."
179
- msgstr "Les tailles d'images crées par votre thème sont en <span style=\"color:#F2A13A\">orange</span> et vos tailles personnalisées sont en <span style=\"color:#89D76A\"> vert </span>."
180
-
181
- #: inc/class.admin.php:303
182
- msgid "Select which thumbnails you want to rebuild:"
183
- msgstr "Sélectionnez les tailles de vignettes à régénérer"
184
-
185
- #: inc/class.admin.php:308
186
- #: inc/class.admin.php:367
187
- msgid "Size name"
188
- msgstr "Nom de la taille"
189
-
190
- #: inc/class.admin.php:309
191
- #: inc/class.admin.php:368
192
- msgid "Width"
193
- msgstr "Largeur"
194
-
195
- #: inc/class.admin.php:310
196
- #: inc/class.admin.php:369
197
- msgid "Height"
198
- msgstr "Hauteur"
199
-
200
- #: inc/class.admin.php:375
201
- msgid "Select which post type source thumbnails you want to rebuild:"
202
- msgstr "Sélectionnez quelles vignettes de quel type de contenu vous souhaitez régénérer : "
203
-
204
- #: inc/class.admin.php:380
205
- #: inc/class.admin.php:405
206
- msgid "Post type"
207
- msgstr "Type de contenu"
208
-
209
- #: inc/class.admin.php:427
210
- msgid "End time calculated :"
211
- msgstr "Fin du traitement calculé :"
212
-
213
- #: inc/class.admin.php:438
214
- msgid "Last image:"
215
- msgstr "Dernière image :"
216
-
217
- #: inc/class.admin.php:439
218
- msgid "Regenerate Thumbnails"
219
- msgstr "Régénérer les vignettes"
220
-
221
- #: inc/class.admin.php:631
222
- msgid "Trying to cheat ?"
223
- msgstr "Cheater ?"
224
-
225
- #: inc/class.admin.php:640
226
- msgid "No id given in POST datas."
227
- msgstr "Pas d'id donné dans les données du POST."
228
-
229
- #: inc/class.admin.php:650
230
- #, php-format
231
- msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
232
- msgstr "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
233
-
234
- #: inc/class.admin.php:652
235
- #, php-format
236
- msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
237
- msgstr "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
238
-
239
- #~ msgid "Size "
240
- #~ msgstr "Taille "
241
-
242
- #~ msgid "Theme size"
243
- #~ msgstr "Taille de thème"
244
-
245
- #~ msgid "Add a new size of thumbnail"
246
- #~ msgstr "Ajouter une nouvelle taille de vignette"
247
-
248
- #~ msgid "Get the PHP for the theme"
249
- #~ msgstr "Récupérer le PHP pour le thème"
250
-
251
- #~ msgid "Resize ?"
252
- #~ msgstr "Regénérer ?"
 
 
 
 
 
1
+ # Copyright (C) 2010
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Simple image sizes\n"
6
+ "Report-Msgid-Bugs-To: \n"
7
+ "POT-Creation-Date: 2012-01-20 14:53+0100\n"
8
+ "PO-Revision-Date: 2012-01-20 14:54+0100\n"
9
+ "Last-Translator: Nicolas <njuen@beapi.fr>\n"
10
+ "Language-Team: Beapi <njuen@beapi.fr>\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "X-Poedit-Language: French\n"
15
+ "X-Poedit-Country: FRANCE\n"
16
+ "X-Poedit-SourceCharset: utf-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;__\n"
18
+ "X-Poedit-Basepath: ../\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+
21
+ #: inc/class.admin.php:74
22
+ msgid "Reading attachments..."
23
+ msgstr "Chargement des médias..."
24
+
25
+ #: inc/class.admin.php:75
26
+ #: inc/class.admin.php:237
27
+ msgid "Maximum width"
28
+ msgstr "Largeur maximum"
29
+
30
+ #: inc/class.admin.php:76
31
+ #: inc/class.admin.php:241
32
+ msgid "Maximum height"
33
+ msgstr "Hauteur maximum"
34
+
35
+ #: inc/class.admin.php:77
36
+ #: inc/class.admin.php:250
37
+ #: inc/class.admin.php:323
38
+ #: inc/class.admin.php:382
39
+ msgid "Crop ?"
40
+ msgstr "Rogner ?"
41
+
42
+ #: inc/class.admin.php:78
43
+ #: inc/class.admin.php:370
44
+ msgid "yes"
45
+ msgstr "oui"
46
+
47
+ #: inc/class.admin.php:79
48
+ #: inc/class.admin.php:370
49
+ msgid "no"
50
+ msgstr "non"
51
+
52
+ #: inc/class.admin.php:80
53
+ #: inc/class.admin.php:253
54
+ msgid "Show in post insertion ?"
55
+ msgstr "Afficher dans l'insertion ?"
56
+
57
+ #: inc/class.admin.php:81
58
+ msgid " of "
59
+ msgstr " de "
60
+
61
+ #: inc/class.admin.php:82
62
+ msgid " or "
63
+ msgstr " ou "
64
+
65
+ #: inc/class.admin.php:83
66
+ msgid " before the end."
67
+ msgstr " avant la fin."
68
+
69
+ #: inc/class.admin.php:84
70
+ #: inc/class.admin.php:255
71
+ msgid "Delete"
72
+ msgstr "Supprimer"
73
+
74
+ #: inc/class.admin.php:85
75
+ msgid "No media in your site to regenerate !"
76
+ msgstr "Pas de médias à regénérer !"
77
+
78
+ #: inc/class.admin.php:86
79
+ msgid "Regenerating "
80
+ msgstr "Regénération "
81
+
82
+ #: inc/class.admin.php:87
83
+ msgid "Validate image size name"
84
+ msgstr "Valider le nom de la taille d'image"
85
+
86
+ #: inc/class.admin.php:88
87
+ msgid "Done."
88
+ msgstr "Fini."
89
+
90
+ #: inc/class.admin.php:89
91
+ msgid "Size"
92
+ msgstr "Taille "
93
+
94
+ #: inc/class.admin.php:90
95
+ msgid "Don't use the basic Wordpress thumbnail size name, use the form above to edit them"
96
+ msgstr "N'utilisez pas les tailles par défaut de WordPress comme nom de taille, éditez leurs valeurs avec le formulaire ci-dessus."
97
+
98
+ #: inc/class.admin.php:91
99
+ msgid "This size is already registered, edit it instead of recreating it."
100
+ msgstr "Cette taille existe déjà, éditez la au lieu de la recréer."
101
+
102
+ #: inc/class.admin.php:92
103
+ msgid "Do you really want to delete these size ?"
104
+ msgstr "Voulez-vous réellement supprimer cette taille ?"
105
+
106
+ #: inc/class.admin.php:93
107
+ #: inc/class.admin.php:256
108
+ msgid "Update"
109
+ msgstr "Mettre à jour"
110
+
111
+ #: inc/class.admin.php:94
112
+ msgid "Error requesting page"
113
+ msgstr "Erreur lors de la requête vers la page"
114
+
115
+ #: inc/class.admin.php:95
116
+ msgid "images have been regenerated !"
117
+ msgstr "images ont été regénérées !"
118
+
119
+ #: inc/class.admin.php:96
120
+ msgid "Validate"
121
+ msgstr "Valider"
122
+
123
+ #: inc/class.admin.php:97
124
+ msgid " started at"
125
+ msgstr " commencé à "
126
+
127
+ #: inc/class.admin.php:98
128
+ #: inc/class.admin.php:245
129
+ msgid "Public name"
130
+ msgstr "Nom public"
131
+
132
+ #: inc/class.admin.php:99
133
+ msgid " finished at :"
134
+ msgstr " terminé à :"
135
+
136
+ #: inc/class.admin.php:100
137
+ msgid "Error during the php treatment, be sure to not have php errors in your page"
138
+ msgstr "Erreur durant le traitement, soyez sûr de ne pas avoir d'erreurs php dans votre page"
139
+
140
+ #: inc/class.admin.php:101
141
+ msgid "All the sizes you have modifed are not saved, continue anyway ?"
142
+ msgstr "Toutes les tailles qui ont été modifiée n'ont pas été sauvées, continuer tout de même ?"
143
+
144
+ #: inc/class.admin.php:102
145
+ #, php-format
146
+ msgid "This image has been regenerated in %s seconds"
147
+ msgstr "Cette image a été regénérée en %s secondes"
148
+
149
+ #: inc/class.admin.php:117
150
+ msgid "Regenerate thumbnails"
151
+ msgstr "Régénérer les vignettes"
152
+
153
+ #: inc/class.admin.php:137
154
+ msgid "Settings"
155
+ msgstr "Paramètres"
156
+
157
+ #: inc/class.admin.php:186
158
+ #, php-format
159
+ msgid "%s size"
160
+ msgstr "Taille %s"
161
+
162
+ #: inc/class.admin.php:193
163
+ msgid "Add a new size"
164
+ msgstr "Ajouter une nouvelle taille"
165
+
166
+ #: inc/class.admin.php:196
167
+ msgid "Legend of the sizes"
168
+ msgstr "Légende des tailles"
169
+
170
+ #: inc/class.admin.php:199
171
+ msgid "Get php for theme"
172
+ msgstr "Récupérer le PHP pour le thème"
173
+
174
+ #: inc/class.admin.php:202
175
+ msgid "Thumbnail regeneration"
176
+ msgstr "Régénération des vignettes"
177
+
178
+ #: inc/class.admin.php:282
179
+ msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
180
+ msgstr "Copiez et collez le code ci-dessous dans votre fichier de fonctions de votre thème WordPress si vous voulez les conserver et désactiver ce plugin."
181
+
182
+ #: inc/class.admin.php:295
183
+ msgid "The images created on your theme are <span style=\"color:#F2A13A\">orange</span> and your custom size are <span style=\"color:#89D76A\"> green </span>."
184
+ msgstr "Les tailles d'images crées par votre thème sont en <span style=\"color:#F2A13A\">orange</span> et vos tailles personnalisées sont en <span style=\"color:#89D76A\"> vert </span>."
185
+
186
+ #: inc/class.admin.php:315
187
+ msgid "Select which thumbnails you want to rebuild:"
188
+ msgstr "Sélectionnez les tailles de vignettes à régénérer"
189
+
190
+ #: inc/class.admin.php:320
191
+ #: inc/class.admin.php:379
192
+ msgid "Size name"
193
+ msgstr "Nom de la taille"
194
+
195
+ #: inc/class.admin.php:321
196
+ #: inc/class.admin.php:380
197
+ msgid "Width"
198
+ msgstr "Largeur"
199
+
200
+ #: inc/class.admin.php:322
201
+ #: inc/class.admin.php:381
202
+ msgid "Height"
203
+ msgstr "Hauteur"
204
+
205
+ #: inc/class.admin.php:387
206
+ msgid "Select which post type source thumbnails you want to rebuild:"
207
+ msgstr "Sélectionnez quelles vignettes de quel type de contenu vous souhaitez régénérer : "
208
+
209
+ #: inc/class.admin.php:392
210
+ #: inc/class.admin.php:420
211
+ msgid "Post type"
212
+ msgstr "Type de contenu"
213
+
214
+ #: inc/class.admin.php:442
215
+ msgid "End time calculated :"
216
+ msgstr "Fin du traitement calculé :"
217
+
218
+ #: inc/class.admin.php:453
219
+ msgid "Last image:"
220
+ msgstr "Dernière image :"
221
+
222
+ #: inc/class.admin.php:454
223
+ msgid "Regenerate Thumbnails"
224
+ msgstr "Régénérer les vignettes"
225
+
226
+ #: inc/class.admin.php:647
227
+ msgid "Trying to cheat ?"
228
+ msgstr "Cheater ?"
229
+
230
+ #: inc/class.admin.php:656
231
+ msgid "No id given in POST datas."
232
+ msgstr "Pas d'id donné dans les données du POST."
233
+
234
+ #: inc/class.admin.php:666
235
+ #, php-format
236
+ msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
237
+ msgstr "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
238
+
239
+ #: inc/class.admin.php:668
240
+ #, php-format
241
+ msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
242
+ msgstr "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
243
+
244
+ #~ msgid "Size "
245
+ #~ msgstr "Taille "
246
+
247
+ #~ msgid "Theme size"
248
+ #~ msgstr "Taille de thème"
249
+
250
+ #~ msgid "Add a new size of thumbnail"
251
+ #~ msgstr "Ajouter une nouvelle taille de vignette"
252
+
253
+ #~ msgid "Get the PHP for the theme"
254
+ #~ msgstr "Récupérer le PHP pour le thème"
255
+
256
+ #~ msgid "Resize ?"
257
+ #~ msgstr "Regénérer ?"
languages/sis.pot CHANGED
@@ -1,211 +1,254 @@
1
- # Copyright (C) 2010
2
- # This file is distributed under the same license as the package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: \n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-image-sizes\n"
7
- "POT-Creation-Date: 2011-07-05 19:34:56+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
-
15
- #: inc/class.admin.php:57
16
- msgid "Reading attachments..."
17
- msgstr ""
18
-
19
- #: inc/class.admin.php:58 inc/class.admin.php:198
20
- msgid "Maximum width"
21
- msgstr ""
22
-
23
- #: inc/class.admin.php:59 inc/class.admin.php:203
24
- msgid "Maximum height"
25
- msgstr ""
26
-
27
- #: inc/class.admin.php:60 inc/class.admin.php:209 inc/class.admin.php:281
28
- #: inc/class.admin.php:342
29
- msgid "Crop ?"
30
- msgstr ""
31
-
32
- #: inc/class.admin.php:61 inc/class.admin.php:330
33
- msgid "yes"
34
- msgstr ""
35
-
36
- #: inc/class.admin.php:62 inc/class.admin.php:330
37
- msgid "no"
38
- msgstr ""
39
-
40
- #: inc/class.admin.php:63 inc/class.admin.php:214
41
- msgid "Show in post insertion ?"
42
- msgstr ""
43
-
44
- #: inc/class.admin.php:64
45
- msgid " of "
46
- msgstr ""
47
-
48
- #: inc/class.admin.php:65
49
- msgid " or "
50
- msgstr ""
51
-
52
- #: inc/class.admin.php:66
53
- msgid " before the end."
54
- msgstr ""
55
-
56
- #: inc/class.admin.php:67 inc/class.admin.php:217
57
- msgid "Delete"
58
- msgstr ""
59
-
60
- #: inc/class.admin.php:68
61
- msgid "No media in your site to regenerate !"
62
- msgstr ""
63
-
64
- #: inc/class.admin.php:69
65
- msgid "Regenerating "
66
- msgstr ""
67
-
68
- #: inc/class.admin.php:70
69
- msgid "Validate image size name"
70
- msgstr ""
71
-
72
- #: inc/class.admin.php:71
73
- msgid "Done."
74
- msgstr ""
75
-
76
- #: inc/class.admin.php:72
77
- msgid "Size"
78
- msgstr ""
79
-
80
- #: inc/class.admin.php:73
81
- msgid ""
82
- "Don't use the basic Wordpress thumbnail size name, use the form above to "
83
- "edit them"
84
- msgstr ""
85
-
86
- #: inc/class.admin.php:74
87
- msgid "This size is already registered, edit it instead of recreating it."
88
- msgstr ""
89
-
90
- #: inc/class.admin.php:75
91
- msgid "Do you really want to delete these size ?"
92
- msgstr ""
93
-
94
- #: inc/class.admin.php:76 inc/class.admin.php:218
95
- msgid "Update"
96
- msgstr ""
97
-
98
- #: inc/class.admin.php:77
99
- msgid "Error requesting page"
100
- msgstr ""
101
-
102
- #: inc/class.admin.php:78
103
- msgid "images have been regenerated !"
104
- msgstr ""
105
-
106
- #: inc/class.admin.php:79
107
- msgid "Validate"
108
- msgstr ""
109
-
110
- #: inc/class.admin.php:97
111
- msgid "Settings"
112
- msgstr ""
113
-
114
- #: inc/class.admin.php:147
115
- msgid "Size "
116
- msgstr ""
117
-
118
- #: inc/class.admin.php:154
119
- msgid "Add a new size"
120
- msgstr ""
121
-
122
- #: inc/class.admin.php:157
123
- msgid "Legend of the sizes"
124
- msgstr ""
125
-
126
- #: inc/class.admin.php:160
127
- msgid "Get php for theme"
128
- msgstr ""
129
-
130
- #: inc/class.admin.php:163
131
- msgid "Thumbnail regeneration"
132
- msgstr ""
133
-
134
- #: inc/class.admin.php:191
135
- msgid "Custom size"
136
- msgstr ""
137
-
138
- #: inc/class.admin.php:194
139
- msgid "Theme size"
140
- msgstr ""
141
-
142
- #: inc/class.admin.php:229
143
- msgid "Add a new size of thumbnail"
144
- msgstr ""
145
-
146
- #: inc/class.admin.php:241
147
- msgid "Get the PHP for the theme"
148
- msgstr ""
149
-
150
- #: inc/class.admin.php:242
151
- msgid ""
152
- "Copy and paste the code below into your Wordpress theme function file if you "
153
- "wanted to save them and deactivate the plugin."
154
- msgstr ""
155
-
156
- #: inc/class.admin.php:255
157
- msgid ""
158
- "The images created on your theme are <span style=\"color:#F2A13A\">orange</"
159
- "span> and your custom size are <span style=\"color:#89D76A\"> green </span>."
160
- msgstr ""
161
-
162
- #: inc/class.admin.php:273
163
- msgid "Select which thumbnails you want to rebuild:"
164
- msgstr ""
165
-
166
- #: inc/class.admin.php:277 inc/class.admin.php:338 inc/class.admin.php:351
167
- #: inc/class.admin.php:377
168
- msgid "Resize ?"
169
- msgstr ""
170
-
171
- #: inc/class.admin.php:278 inc/class.admin.php:339
172
- msgid "Size name"
173
- msgstr ""
174
-
175
- #: inc/class.admin.php:279 inc/class.admin.php:340
176
- msgid "Width"
177
- msgstr ""
178
-
179
- #: inc/class.admin.php:280 inc/class.admin.php:341
180
- msgid "Height"
181
- msgstr ""
182
-
183
- #: inc/class.admin.php:347
184
- msgid "Select which post type source thumbnails you want to rebuild:"
185
- msgstr ""
186
-
187
- #: inc/class.admin.php:352 inc/class.admin.php:378
188
- msgid "Post type"
189
- msgstr ""
190
-
191
- #: inc/class.admin.php:400
192
- msgid "End time calculated :"
193
- msgstr ""
194
-
195
- #: inc/class.admin.php:411
196
- msgid "Last image:"
197
- msgstr ""
198
-
199
- #: inc/class.admin.php:412
200
- msgid "Regenerate Thumbnails"
201
- msgstr ""
202
-
203
- #: inc/class.admin.php:577
204
- msgid "No id given in POST datas."
205
- msgstr ""
206
-
207
- #: inc/class.admin.php:587 inc/class.admin.php:589
208
- msgid ""
209
- "This file does not exists and have not been regenerated :<br/><a target="
210
- "\"_blank\" href=\"%1$s\" >%2$s</a>"
211
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2010
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: \n"
6
+ "Report-Msgid-Bugs-To: \n"
7
+ "POT-Creation-Date: 2012-01-20 14:56+0100\n"
8
+ "PO-Revision-Date: 2012-01-20 14:56+0100\n"
9
+ "Last-Translator: Nicolas <njuen@beapi.fr>\n"
10
+ "Language-Team: LANGUAGE <LL@li.org>\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-KeywordsList: esc_attr_e;esc_html_e;esc_attr__;esc_html__;_e;__\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+
18
+ #: ../inc/class.admin.php:74
19
+ msgid "Reading attachments..."
20
+ msgstr ""
21
+
22
+ #: ../inc/class.admin.php:75
23
+ #: ../inc/class.admin.php:237
24
+ msgid "Maximum width"
25
+ msgstr ""
26
+
27
+ #: ../inc/class.admin.php:76
28
+ #: ../inc/class.admin.php:241
29
+ msgid "Maximum height"
30
+ msgstr ""
31
+
32
+ #: ../inc/class.admin.php:77
33
+ #: ../inc/class.admin.php:250
34
+ #: ../inc/class.admin.php:323
35
+ #: ../inc/class.admin.php:382
36
+ msgid "Crop ?"
37
+ msgstr ""
38
+
39
+ #: ../inc/class.admin.php:78
40
+ #: ../inc/class.admin.php:370
41
+ msgid "yes"
42
+ msgstr ""
43
+
44
+ #: ../inc/class.admin.php:79
45
+ #: ../inc/class.admin.php:370
46
+ msgid "no"
47
+ msgstr ""
48
+
49
+ #: ../inc/class.admin.php:80
50
+ #: ../inc/class.admin.php:253
51
+ msgid "Show in post insertion ?"
52
+ msgstr ""
53
+
54
+ #: ../inc/class.admin.php:81
55
+ msgid " of "
56
+ msgstr ""
57
+
58
+ #: ../inc/class.admin.php:82
59
+ msgid " or "
60
+ msgstr ""
61
+
62
+ #: ../inc/class.admin.php:83
63
+ msgid " before the end."
64
+ msgstr ""
65
+
66
+ #: ../inc/class.admin.php:84
67
+ #: ../inc/class.admin.php:255
68
+ msgid "Delete"
69
+ msgstr ""
70
+
71
+ #: ../inc/class.admin.php:85
72
+ msgid "No media in your site to regenerate !"
73
+ msgstr ""
74
+
75
+ #: ../inc/class.admin.php:86
76
+ msgid "Regenerating "
77
+ msgstr ""
78
+
79
+ #: ../inc/class.admin.php:87
80
+ msgid "Validate image size name"
81
+ msgstr ""
82
+
83
+ #: ../inc/class.admin.php:88
84
+ msgid "Done."
85
+ msgstr ""
86
+
87
+ #: ../inc/class.admin.php:89
88
+ msgid "Size"
89
+ msgstr ""
90
+
91
+ #: ../inc/class.admin.php:90
92
+ msgid "Don't use the basic Wordpress thumbnail size name, use the form above to edit them"
93
+ msgstr ""
94
+
95
+ #: ../inc/class.admin.php:91
96
+ msgid "This size is already registered, edit it instead of recreating it."
97
+ msgstr ""
98
+
99
+ #: ../inc/class.admin.php:92
100
+ msgid "Do you really want to delete these size ?"
101
+ msgstr ""
102
+
103
+ #: ../inc/class.admin.php:93
104
+ #: ../inc/class.admin.php:256
105
+ msgid "Update"
106
+ msgstr ""
107
+
108
+ #: ../inc/class.admin.php:94
109
+ msgid "Error requesting page"
110
+ msgstr ""
111
+
112
+ #: ../inc/class.admin.php:95
113
+ msgid "images have been regenerated !"
114
+ msgstr ""
115
+
116
+ #: ../inc/class.admin.php:96
117
+ msgid "Validate"
118
+ msgstr ""
119
+
120
+ #: ../inc/class.admin.php:97
121
+ msgid " started at"
122
+ msgstr ""
123
+
124
+ #: ../inc/class.admin.php:98
125
+ #: ../inc/class.admin.php:245
126
+ msgid "Public name"
127
+ msgstr ""
128
+
129
+ #: ../inc/class.admin.php:99
130
+ msgid " finished at :"
131
+ msgstr ""
132
+
133
+ #: ../inc/class.admin.php:100
134
+ msgid "Error during the php treatment, be sure to not have php errors in your page"
135
+ msgstr ""
136
+
137
+ #: ../inc/class.admin.php:101
138
+ msgid "All the sizes you have modifed are not saved, continue anyway ?"
139
+ msgstr ""
140
+
141
+ #: ../inc/class.admin.php:102
142
+ #, php-format
143
+ msgid "This image has been regenerated in %s seconds"
144
+ msgstr ""
145
+
146
+ #: ../inc/class.admin.php:117
147
+ msgid "Regenerate thumbnails"
148
+ msgstr ""
149
+
150
+ #: ../inc/class.admin.php:137
151
+ msgid "Settings"
152
+ msgstr ""
153
+
154
+ #: ../inc/class.admin.php:186
155
+ #, php-format
156
+ msgid "%s size"
157
+ msgstr ""
158
+
159
+ #: ../inc/class.admin.php:193
160
+ msgid "Add a new size"
161
+ msgstr ""
162
+
163
+ #: ../inc/class.admin.php:196
164
+ msgid "Legend of the sizes"
165
+ msgstr ""
166
+
167
+ #: ../inc/class.admin.php:199
168
+ msgid "Get php for theme"
169
+ msgstr ""
170
+
171
+ #: ../inc/class.admin.php:202
172
+ msgid "Thumbnail regeneration"
173
+ msgstr ""
174
+
175
+ #: ../inc/class.admin.php:238
176
+ #: ../inc/class.admin.php:240
177
+ #: ../inc/class.admin.php:242
178
+ msgid "custom_image_sizes["
179
+ msgstr ""
180
+
181
+ #: ../inc/class.admin.php:269
182
+ msgid "Add a new size of thumbnail"
183
+ msgstr ""
184
+
185
+ #: ../inc/class.admin.php:281
186
+ msgid "Get the PHP for the theme"
187
+ msgstr ""
188
+
189
+ #: ../inc/class.admin.php:282
190
+ msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
191
+ msgstr ""
192
+
193
+ #: ../inc/class.admin.php:295
194
+ msgid "The images created on your theme are <span style=\"color:#F2A13A\">orange</span> and your custom size are <span style=\"color:#89D76A\"> green </span>."
195
+ msgstr ""
196
+
197
+ #: ../inc/class.admin.php:315
198
+ msgid "Select which thumbnails you want to rebuild:"
199
+ msgstr ""
200
+
201
+ #: ../inc/class.admin.php:320
202
+ #: ../inc/class.admin.php:379
203
+ msgid "Size name"
204
+ msgstr ""
205
+
206
+ #: ../inc/class.admin.php:321
207
+ #: ../inc/class.admin.php:380
208
+ msgid "Width"
209
+ msgstr ""
210
+
211
+ #: ../inc/class.admin.php:322
212
+ #: ../inc/class.admin.php:381
213
+ msgid "Height"
214
+ msgstr ""
215
+
216
+ #: ../inc/class.admin.php:387
217
+ msgid "Select which post type source thumbnails you want to rebuild:"
218
+ msgstr ""
219
+
220
+ #: ../inc/class.admin.php:392
221
+ #: ../inc/class.admin.php:420
222
+ msgid "Post type"
223
+ msgstr ""
224
+
225
+ #: ../inc/class.admin.php:442
226
+ msgid "End time calculated :"
227
+ msgstr ""
228
+
229
+ #: ../inc/class.admin.php:453
230
+ msgid "Last image:"
231
+ msgstr ""
232
+
233
+ #: ../inc/class.admin.php:454
234
+ msgid "Regenerate Thumbnails"
235
+ msgstr ""
236
+
237
+ #: ../inc/class.admin.php:647
238
+ msgid "Trying to cheat ?"
239
+ msgstr ""
240
+
241
+ #: ../inc/class.admin.php:656
242
+ msgid "No id given in POST datas."
243
+ msgstr ""
244
+
245
+ #: ../inc/class.admin.php:666
246
+ #, php-format
247
+ msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
248
+ msgstr ""
249
+
250
+ #: ../inc/class.admin.php:668
251
+ #, php-format
252
+ msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
253
+ msgstr ""
254
+
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Rahe
3
  Donate link: http://www.beapi.fr/donate/
4
  Tags: images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate
5
  Requires at least: 3.0
6
- Tested up to: 3.3
7
- Stable tag: 2.2.5
8
 
9
  == Description ==
10
 
@@ -18,6 +18,8 @@ Now you can regenerate the images one by one in the 'Medias' general pane.
18
  I have added a timer so when you regeneration your thumbnails, you can know approximately when the regeneration will be ended.
19
  I have improved the php and javascript, you can know if the image have been regenerated or not or if there is an error and which one.
20
 
 
 
21
  == Installation ==
22
  **PHP5 Required.**
23
 
@@ -34,6 +36,9 @@ I have improved the php and javascript, you can know if the image have been rege
34
  4. Regenerating image sizes
35
 
36
  == Changelog ==
 
 
 
37
  * 2.2.5
38
  * Debug the regeneration buggy !
39
  * Complete the french translation
3
  Donate link: http://www.beapi.fr/donate/
4
  Tags: images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate
5
  Requires at least: 3.0
6
+ Tested up to: 3.3.1
7
+ Stable tag: 2.3
8
 
9
  == Description ==
10
 
18
  I have added a timer so when you regeneration your thumbnails, you can know approximately when the regeneration will be ended.
19
  I have improved the php and javascript, you can know if the image have been regenerated or not or if there is an error and which one.
20
 
21
+ Contribute on https://github.com/Rahe/Simple-image-sizes
22
+
23
  == Installation ==
24
  **PHP5 Required.**
25
 
36
  4. Regenerating image sizes
37
 
38
  == Changelog ==
39
+ * 2.3
40
+ * Add the custom size name in the attachment insertion
41
+ * Exclude post_type wich do not support the post-thumbnail feature
42
  * 2.2.5
43
  * Debug the regeneration buggy !
44
  * Complete the french translation
simple_image_sizes.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Simple Image Size
4
  Plugin URI: http://redmine.beapi.fr/projects/show/simple-image-sizes
5
  Description: Add options in media setting page for images sizes
6
- Version: 2.2.5
7
  Author: Rahe
8
  Author URI: http://nicolas-juen.fr
9
  Text Domain: sis
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
 
30
  define( 'SIS_URL', plugins_url('/', __FILE__) );
31
  define( 'SIS_DIR', dirname(__FILE__) );
32
- define( 'SIS_VERSION', '2.2.5' );
33
  define( 'SIS_OPTION', 'custom_image_sizes' );
34
 
35
  require_once( SIS_DIR . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'class.admin.php' );
3
  Plugin Name: Simple Image Size
4
  Plugin URI: http://redmine.beapi.fr/projects/show/simple-image-sizes
5
  Description: Add options in media setting page for images sizes
6
+ Version: 2.3
7
  Author: Rahe
8
  Author URI: http://nicolas-juen.fr
9
  Text Domain: sis
29
 
30
  define( 'SIS_URL', plugins_url('/', __FILE__) );
31
  define( 'SIS_DIR', dirname(__FILE__) );
32
+ define( 'SIS_VERSION', '2.3' );
33
  define( 'SIS_OPTION', 'custom_image_sizes' );
34
 
35
  require_once( SIS_DIR . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'class.admin.php' );