Crop-Thumbnails - Version 0.7.1

Version Description

  • add language: brazilian portuguese (pt_br)
  • bug fix: fixes for the upcoming Wordpress 3.5
  • bug fix: in crop editor, if an original image is larger than a single selected image-size, the predefined selection will now be on maximum possible size
  • bug fix: ensure that other plugins cant add styles and scripts into the crop-thumbnail-iframe
Download this release

Release Info

Developer Volkmar Kantor
Plugin Icon Crop-Thumbnails
Version 0.7.1
Comparing to
See all releases

Code changes from version 0.7.0 to 0.7.1

crop-thumbnails.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://wordpress.org/extend/plugins/crop-thumbnails/
5
  * Author: Volkmar Kantor
6
  * Author URI: http://www.totalmedial.de
7
- * Version: 0.7.0
8
  * Description: Crop your thumbnails, the easy way.
9
  * Text Domain: cpt_lang
10
  *
@@ -27,7 +27,7 @@
27
 
28
  //cpt - stands for crop-post-thumbnail
29
  define('CPT_LANG','cpt_lang');
30
- define('CPT_VERSION','0.7.0');
31
 
32
  function cpt_plugin_init() {
33
  load_plugin_textdomain( CPT_LANG, false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
@@ -36,8 +36,20 @@ function cpt_plugin_init() {
36
  }
37
  add_action('plugins_loaded', 'cpt_plugin_init');
38
 
 
 
 
 
 
 
 
 
 
39
  include_once(dirname(__FILE__).'/functions/settings.php');
40
  include_once(dirname(__FILE__).'/functions/editor.php');
41
  include_once(dirname(__FILE__).'/functions/save.php');
 
 
 
42
 
43
  ?>
4
  * Plugin URI: http://wordpress.org/extend/plugins/crop-thumbnails/
5
  * Author: Volkmar Kantor
6
  * Author URI: http://www.totalmedial.de
7
+ * Version: 0.7.1
8
  * Description: Crop your thumbnails, the easy way.
9
  * Text Domain: cpt_lang
10
  *
27
 
28
  //cpt - stands for crop-post-thumbnail
29
  define('CPT_LANG','cpt_lang');
30
+ define('CPT_VERSION','0.7.1');
31
 
32
  function cpt_plugin_init() {
33
  load_plugin_textdomain( CPT_LANG, false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
36
  }
37
  add_action('plugins_loaded', 'cpt_plugin_init');
38
 
39
+ /**
40
+ * returns the WpVersion in as a float
41
+ */
42
+ function cptGetWpVersion() {
43
+ $version = get_bloginfo('version');
44
+ $version = floatval(substr($version,0,3));
45
+ return $version;
46
+ }
47
+
48
  include_once(dirname(__FILE__).'/functions/settings.php');
49
  include_once(dirname(__FILE__).'/functions/editor.php');
50
  include_once(dirname(__FILE__).'/functions/save.php');
51
+ if(cptGetWpVersion() >= 3.5) {
52
+ include_once(dirname(__FILE__).'/functions/featured-image-meta-box.php');
53
+ }
54
 
55
  ?>
css/cpt-window.css CHANGED
@@ -9,13 +9,13 @@
9
  .image-list .cursor, .image-list .cursor * { cursor:pointer;}
10
 
11
  .header {background-color:#efefef; padding:5px; position: relative; z-index: 1000;}
12
- .cpt-crop-view .right {width:300px; float:right; border-left:3px solid #efefef; padding:5px 5px 0 10px; }
13
  .thumbnail-list { border-top: 3px solid #efefef; padding-top:5px; margin-top:5px; }
14
  .thumbnail-list li { padding:5px; border:1px solid white; cursor:pointer; }
15
  .thumbnail-list li:hover { border:1px solid #aad6f4; }
16
  .thumbnail-list li.active { background-color:#aad6f4; border:1px solid #aad6f4; }
17
  .thumbnail-list li span { display:block; font-size:0.8em; }
18
- .thumbnail-list li img { max-width:100%; height: auto;}
19
  .thumbnail-list li .lowResWarning { font-style: italic; color:#990000;}
20
 
21
  .lbl-cpt-same-ratio {font-size:0.9em;}
9
  .image-list .cursor, .image-list .cursor * { cursor:pointer;}
10
 
11
  .header {background-color:#efefef; padding:5px; position: relative; z-index: 1000;}
12
+ .cpt-crop-view .cptRightPane {width:300px; float:right; border-left:3px solid #efefef; padding:5px 5px 0 10px; }
13
  .thumbnail-list { border-top: 3px solid #efefef; padding-top:5px; margin-top:5px; }
14
  .thumbnail-list li { padding:5px; border:1px solid white; cursor:pointer; }
15
  .thumbnail-list li:hover { border:1px solid #aad6f4; }
16
  .thumbnail-list li.active { background-color:#aad6f4; border:1px solid #aad6f4; }
17
  .thumbnail-list li span { display:block; font-size:0.8em; }
18
+ .thumbnail-list li img { max-width:100%; height: auto; max-height:250px;}
19
  .thumbnail-list li .lowResWarning { font-style: italic; color:#990000;}
20
 
21
  .lbl-cpt-same-ratio {font-size:0.9em;}
functions/editor.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  class CropPostThumbnailsEditor {
4
 
5
  function __construct() {
@@ -116,12 +115,14 @@ class CropPostThumbnailsEditor {
116
  $cptContent = ob_get_clean();
117
  //END the content
118
  }
 
119
  wp_enqueue_script( 'jquery' );
120
  wp_enqueue_style( 'cpt-window',plugins_url('css/cpt-window.css',dirname(__FILE__)),array('wp-admin'),CPT_VERSION);
121
  include_once( dirname(__FILE__).'/../html/template.php' );
122
  return true;
123
  }
124
 
 
125
  /**
126
  * Display the crop editor.
127
  * @param $_REQUEST['image_id'] - ID of the image to show
@@ -157,13 +158,6 @@ class CropPostThumbnailsEditor {
157
  $orig_img = wp_get_attachment_image_src($image_obj->ID, 'full');
158
  $cache_breaker = time();//a additional parameter that will be added to the image-urls to prevent the browser to show a cached image
159
 
160
- wp_enqueue_script( 'jquery' );
161
- wp_enqueue_script( 'jcrop' );
162
- wp_enqueue_script( 'json2' );
163
- wp_enqueue_script( 'cpt-crop', plugins_url('js/cpt-crop.js',dirname(__FILE__)));
164
-
165
- wp_enqueue_style( 'cpt-window',plugins_url('css/cpt-window.css',dirname(__FILE__)),array('wp-admin'),CPT_VERSION);
166
- wp_enqueue_style( 'jcrop' );
167
 
168
  //the javascript
169
  ob_start(); ?>
@@ -201,7 +195,7 @@ jQuery(document).ready(function($) {
201
  <?php if($headline) :?><div class="header"><a class="back" href="<?php echo admin_url( 'admin-ajax.php'); ?>?action=croppostthumb_ajax&post_id=<?php echo $current_parent_post_id; ?>"><?php _e('back to image-list',CPT_LANG); ?></a></div><?php endif; ?>
202
  <div class="waitingWindow hidden"><?php _e('Please wait until the Images are cropped.',CPT_LANG); ?></div>
203
  <div class="mainWindow">
204
- <div class="selectionArea left">
205
  <h3><?php _e('Raw',CPT_LANG); ?>: <?php echo $orig_img[1].' '.__('pixel',CPT_LANG)?> x <?php echo $orig_img[2].' '.__('pixel',CPT_LANG) ?></h3>
206
  <img src="<?php echo $orig_img[0]?>" data-values='{"id":<?php echo $image_obj->ID; ?>,"parentId":<?php echo $post_id_attached ?>,"width":<?php echo $orig_img[1]?>,"height":<?php echo $orig_img[2] ?>}' />
207
  <button id="cpt-generate" class="button"><?php _e('save crop',CPT_LANG);?></button>
@@ -212,7 +206,7 @@ jQuery(document).ready(function($) {
212
  <li><?php _e('Step 3: Click on "save crop".',CPT_LANG); ?></li>
213
  </ul>
214
  </div>
215
- <div class="right">
216
  <input type="checkbox" name="cpt-same-ratio" value="1" id="cpt-same-ratio" checked="checked" />
217
  <label for="cpt-same-ratio" class="lbl-cpt-same-ratio"><?php _e('select images with same ratio at once',CPT_LANG); ?></label>
218
  <button id="cpt-deselect" class="button"><?php _e('deselect all',CPT_LANG); ?></button>
@@ -258,6 +252,19 @@ jQuery(document).ready(function($) {
258
  $cptContent = ob_get_clean();
259
  //END the content
260
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  include_once( dirname(__FILE__).'/../html/template.php' );
262
 
263
  $content_width = $_remember_content_width;//reset the content-width
@@ -344,13 +351,24 @@ jQuery(document).ready(function($) {
344
  return $return;
345
  }
346
 
 
 
 
347
  function adminHeaderCSS() {
348
  global $pagenow;
349
- if ( $pagenow == 'upload.php' ) {
 
 
 
 
350
  wp_enqueue_style( 'thickbox' );
351
  }
352
  }
353
 
 
 
 
 
354
  function adminHeaderJS() {
355
  global $pagenow;
356
 
@@ -359,10 +377,27 @@ jQuery(document).ready(function($) {
359
  || $pagenow == 'page.php'
360
  || $pagenow == 'page-new.php'
361
  || $pagenow == 'upload.php') {
362
- wp_enqueue_script('cpt-js', plugins_url( 'js/cpt-main.js', dirname(__FILE__) ), array('jquery','jquery-ui-tabs','thickbox'));
 
 
 
 
 
363
  }
364
  }
365
 
 
 
 
 
 
 
 
 
 
 
 
 
366
  /**
367
  * Greatest cummon divisor
368
  */
1
  <?php
 
2
  class CropPostThumbnailsEditor {
3
 
4
  function __construct() {
115
  $cptContent = ob_get_clean();
116
  //END the content
117
  }
118
+ $this->cleanWPHead();
119
  wp_enqueue_script( 'jquery' );
120
  wp_enqueue_style( 'cpt-window',plugins_url('css/cpt-window.css',dirname(__FILE__)),array('wp-admin'),CPT_VERSION);
121
  include_once( dirname(__FILE__).'/../html/template.php' );
122
  return true;
123
  }
124
 
125
+
126
  /**
127
  * Display the crop editor.
128
  * @param $_REQUEST['image_id'] - ID of the image to show
158
  $orig_img = wp_get_attachment_image_src($image_obj->ID, 'full');
159
  $cache_breaker = time();//a additional parameter that will be added to the image-urls to prevent the browser to show a cached image
160
 
 
 
 
 
 
 
 
161
 
162
  //the javascript
163
  ob_start(); ?>
195
  <?php if($headline) :?><div class="header"><a class="back" href="<?php echo admin_url( 'admin-ajax.php'); ?>?action=croppostthumb_ajax&post_id=<?php echo $current_parent_post_id; ?>"><?php _e('back to image-list',CPT_LANG); ?></a></div><?php endif; ?>
196
  <div class="waitingWindow hidden"><?php _e('Please wait until the Images are cropped.',CPT_LANG); ?></div>
197
  <div class="mainWindow">
198
+ <div class="selectionArea cptLeftPane">
199
  <h3><?php _e('Raw',CPT_LANG); ?>: <?php echo $orig_img[1].' '.__('pixel',CPT_LANG)?> x <?php echo $orig_img[2].' '.__('pixel',CPT_LANG) ?></h3>
200
  <img src="<?php echo $orig_img[0]?>" data-values='{"id":<?php echo $image_obj->ID; ?>,"parentId":<?php echo $post_id_attached ?>,"width":<?php echo $orig_img[1]?>,"height":<?php echo $orig_img[2] ?>}' />
201
  <button id="cpt-generate" class="button"><?php _e('save crop',CPT_LANG);?></button>
206
  <li><?php _e('Step 3: Click on "save crop".',CPT_LANG); ?></li>
207
  </ul>
208
  </div>
209
+ <div class="cptRightPane">
210
  <input type="checkbox" name="cpt-same-ratio" value="1" id="cpt-same-ratio" checked="checked" />
211
  <label for="cpt-same-ratio" class="lbl-cpt-same-ratio"><?php _e('select images with same ratio at once',CPT_LANG); ?></label>
212
  <button id="cpt-deselect" class="button"><?php _e('deselect all',CPT_LANG); ?></button>
252
  $cptContent = ob_get_clean();
253
  //END the content
254
 
255
+
256
+ $this->cleanWPHead();
257
+ wp_enqueue_script( 'jquery' );
258
+ wp_enqueue_script( 'jcrop' );
259
+ wp_enqueue_script( 'json2' );
260
+ if(cptGetWpVersion() < 3.5) {
261
+ wp_enqueue_script( 'cpt-crop', plugins_url('js/vers-0-7-0/cpt-crop.js',dirname(__FILE__)));
262
+ } else {
263
+ wp_enqueue_script( 'cpt-crop', plugins_url('js/cpt-crop.js',dirname(__FILE__)));
264
+ }
265
+
266
+ wp_enqueue_style( 'cpt-window',plugins_url('css/cpt-window.css',dirname(__FILE__)),array('wp-admin'),CPT_VERSION);
267
+ wp_enqueue_style( 'jcrop' );
268
  include_once( dirname(__FILE__).'/../html/template.php' );
269
 
270
  $content_width = $_remember_content_width;//reset the content-width
351
  return $return;
352
  }
353
 
354
+ /**
355
+ * For adding the "thickbox"-style in the mediathek
356
+ */
357
  function adminHeaderCSS() {
358
  global $pagenow;
359
+ if ( $pagenow == 'post.php'
360
+ || $pagenow == 'post-new.php'
361
+ || $pagenow == 'page.php'
362
+ || $pagenow == 'page-new.php'
363
+ || $pagenow == 'upload.php') {
364
  wp_enqueue_style( 'thickbox' );
365
  }
366
  }
367
 
368
+
369
+ /**
370
+ * For adding the "crop-thumbnail"-link on posts, pages and the mediathek
371
+ */
372
  function adminHeaderJS() {
373
  global $pagenow;
374
 
377
  || $pagenow == 'page.php'
378
  || $pagenow == 'page-new.php'
379
  || $pagenow == 'upload.php') {
380
+
381
+ if(cptGetWpVersion() < 3.5) {
382
+ wp_enqueue_script('cpt-js', plugins_url( 'js/vers-0-7-0/cpt-main.js', dirname(__FILE__) ), array('jquery','jquery-ui-tabs','thickbox'));
383
+ } else {
384
+ wp_enqueue_script('cpt-js', plugins_url( 'js/cpt-main.js', dirname(__FILE__) ), array('jquery','jquery-ui-tabs','thickbox'));
385
+ }
386
  }
387
  }
388
 
389
+ /**
390
+ * This is for use inside the plugin only.
391
+ * Removes all other styles and scripts, to make sure the crop-thumbnail is not compromited by other plugins
392
+ */
393
+ function cleanWPHead() {
394
+ global $wp_scripts, $wp_styles;
395
+ $wp_scripts = new WP_Scripts();
396
+ $wp_styles = new WP_Styles();
397
+ remove_all_actions('wp_print_styles');
398
+ remove_all_actions('wp_print_scripts');
399
+ }
400
+
401
  /**
402
  * Greatest cummon divisor
403
  */
functions/featured-image-meta-box.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('add_meta_boxes', 'cptChangeFeaturedImageMetaBox');
3
+ function cptChangeFeaturedImageMetaBox($post_type) {
4
+ if ( current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ) ) {
5
+ remove_meta_box('postimagediv', null, 'side');
6
+ add_meta_box('postimagediv', __('Featured Image'), 'cptFeaturedImageMetaBox', null, 'side', 'low');
7
+ }
8
+ }
9
+
10
+
11
+ function cptFeaturedImageMetaBox($post) {
12
+ /**
13
+ * Display post thumbnail meta box.
14
+ *
15
+ * @since 2.9.0
16
+ */
17
+ //function post_thumbnail_meta_box( $post ) {
18
+ global $_wp_additional_image_sizes;
19
+
20
+ ?><script type="text/javascript">
21
+ jQuery( function($) {
22
+ var $element = $('#select-featured-image'),
23
+ $thumbnailId = $element.find('input[name="thumbnail_id"]'),
24
+ title = '<?php _e( "Choose a Featured Image" ); ?>',
25
+ update = '<?php _e( "Update Featured Image" ); ?>',
26
+ Attachment = wp.media.model.Attachment,
27
+ frame, setFeaturedImage;
28
+
29
+ setFeaturedImage = function( thumbnailId ) {
30
+ var selection;
31
+
32
+ $element.find('img').remove();
33
+ $element.toggleClass( 'has-featured-image', -1 != thumbnailId );
34
+ $thumbnailId.val( thumbnailId );
35
+
36
+ if ( frame ) {
37
+ selection = frame.get('library').get('selection');
38
+
39
+ if ( -1 === thumbnailId )
40
+ selection.clear();
41
+ else
42
+ selection.add( Attachment.get( thumbnailId ) );
43
+ }
44
+ /** plugin: crop-thumbnail code **/
45
+ cptCheck_SetFeaturedImage();
46
+ /** END plugin: crop-thumbnail code **/
47
+ };
48
+
49
+ $element.on( 'click', '.choose, img', function( event ) {
50
+ var options, thumbnailId;
51
+
52
+ event.preventDefault();
53
+
54
+ if ( frame ) {
55
+ frame.open();
56
+ return;
57
+ }
58
+
59
+ options = {
60
+ title: title,
61
+ library: {
62
+ type: 'image'
63
+ }
64
+ };
65
+
66
+ thumbnailId = $thumbnailId.val();
67
+ if ( '' !== thumbnailId && -1 !== thumbnailId )
68
+ options.selection = [ Attachment.get( thumbnailId ) ];
69
+
70
+ frame = wp.media( options );
71
+
72
+ frame.toolbar.on( 'activate:select', function() {
73
+ frame.toolbar.view().set({
74
+ select: {
75
+ style: 'primary',
76
+ text: update,
77
+
78
+ click: function() {
79
+ var selection = frame.state().get('selection'),
80
+ model = selection.first(),
81
+ sizes = model.get('sizes'),
82
+ size;
83
+
84
+ setFeaturedImage( model.id );
85
+
86
+ // @todo: might need a size hierarchy equivalent.
87
+ if ( sizes )
88
+ size = sizes['post-thumbnail'] || sizes.medium;
89
+
90
+ // @todo: Need a better way of accessing full size
91
+ // data besides just calling toJSON().
92
+ size = size || model.toJSON();
93
+
94
+ frame.close();
95
+
96
+ $( '<img />', {
97
+ src: size.url,
98
+ width: size.width
99
+ }).prependTo( $element );
100
+ }
101
+ }
102
+ });
103
+ });
104
+ });
105
+
106
+ $element.on( 'click', '.remove', function( event ) {
107
+ event.preventDefault();
108
+ setFeaturedImage( -1 );
109
+ });
110
+
111
+ cptCheck_SetFeaturedImage();
112
+ });
113
+ </script>
114
+
115
+ <?php
116
+ $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
117
+ $thumbnail_size = isset( $_wp_additional_image_sizes['post-thumbnail'] ) ? 'post-thumbnail' : 'medium';
118
+ $thumbnail_html = wp_get_attachment_image( $thumbnail_id, $thumbnail_size );
119
+
120
+ $classes = empty( $thumbnail_id ) ? '' : 'has-featured-image';
121
+
122
+ ?><div id="select-featured-image"
123
+ class="<?php echo esc_attr( $classes ); ?>"
124
+ data-post-id="<?php echo esc_attr( $post->ID ); ?>">
125
+ <?php echo $thumbnail_html; ?>
126
+ <input type="hidden" name="thumbnail_id" value="<?php echo esc_attr( $thumbnail_id ); ?>" />
127
+ <a href="#" class="choose button-secondary"><?php _e( 'Choose a Featured Image' ); ?></a>
128
+ <a href="#" class="remove"><?php _e( 'Remove Featured Image' ); ?></a>
129
+ </div>
130
+ <?php
131
+ }
132
+ ?>
html/template.php CHANGED
@@ -3,7 +3,6 @@
3
  <head>
4
  <title>test</title>
5
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
6
-
7
  <?php wp_print_styles(); ?>
8
  <?php wp_print_scripts(); ?>
9
  <script type="text/javascript" charset="utf-8">
3
  <head>
4
  <title>test</title>
5
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
 
6
  <?php wp_print_styles(); ?>
7
  <?php wp_print_scripts(); ?>
8
  <script type="text/javascript" charset="utf-8">
js/cpt-crop.js CHANGED
@@ -127,7 +127,8 @@ jQuery(document).ready(function($) {
127
 
128
  function deactivateArea(c) {
129
  if(c.api!=-1) {
130
- c.api.destroy();
 
131
  }
132
  }
133
 
@@ -145,13 +146,13 @@ jQuery(document).ready(function($) {
145
  alert(cpt_lang['bug']);
146
  }
147
 
148
- //we only need to check in one dimension, cause per definition all images have to use the same ratio
149
  if($(this).data('values').width > largestWidth) {
150
  largestWidth = $(this).data('values').width;
151
  largestHeight = $(this).data('values').height;
152
  }
153
  });
154
-
155
 
156
  var scale = c.img.width() / largestWidth;
157
  var preSelect = [ 0, 0, Math.round(scale*c.img.width()), Math.round(scale*c.img.height()) ];
@@ -167,10 +168,15 @@ jQuery(document).ready(function($) {
167
  options.setSelect = preSelect;
168
  if(largestWidth>cropping.img.data('values').width || largestHeight>cropping.img.data('values').height) {
169
  alert(cpt_lang['warningOriginalToSmall']);
 
 
 
 
 
170
  } else {
171
  options.minSize = minSize;
172
  }
173
- console.log('options',options);
174
 
175
  c.api = $.Jcrop(c.img, options);
176
  }
127
 
128
  function deactivateArea(c) {
129
  if(c.api!=-1) {
130
+ c.api.release();
131
+ c.api.disable();
132
  }
133
  }
134
 
146
  alert(cpt_lang['bug']);
147
  }
148
 
149
+ //we only need to check in one dimension, cause per definition all selected images have to use the same ratio
150
  if($(this).data('values').width > largestWidth) {
151
  largestWidth = $(this).data('values').width;
152
  largestHeight = $(this).data('values').height;
153
  }
154
  });
155
+
156
 
157
  var scale = c.img.width() / largestWidth;
158
  var preSelect = [ 0, 0, Math.round(scale*c.img.width()), Math.round(scale*c.img.height()) ];
168
  options.setSelect = preSelect;
169
  if(largestWidth>cropping.img.data('values').width || largestHeight>cropping.img.data('values').height) {
170
  alert(cpt_lang['warningOriginalToSmall']);
171
+ if(ratio>=0) {
172
+ options.setSelect = [ 0, 0, cropping.img.data('values').width, Math.round(scale*c.img.height()) ];
173
+ } else {
174
+ options.setSelect = [ 0, 0, Math.round(scale*c.img.width()) , cropping.img.data('values').height];
175
+ }
176
  } else {
177
  options.minSize = minSize;
178
  }
179
+ //console.log('options',options);
180
 
181
  c.api = $.Jcrop(c.img, options);
182
  }
js/cpt-main.js CHANGED
@@ -9,23 +9,6 @@ jQuery(document).ready(function($) {
9
 
10
  /** add link on top of editor **/
11
  $('#wp-content-media-buttons').append('<a style="margin:0 2em;" class="thickbox" href="' + ajaxurl + '?action=croppostthumb_ajax&amp;post_id=' + post_id_hidden + '&amp;TB_iframe=1&amp;width=800&amp;height=' + boxViewportHeight + '" title="Crop-Thumbnails">Crop-Thumbnails</a>');
12
-
13
-
14
- /** add link to meta-box for post-thumbnails on posts and pages **/
15
- /* static way: after reload of the page */
16
- $('#remove-post-thumbnail').parent().parent().append('<a class="thickbox" href="' + ajaxurl + '?action=croppostthumb_ajax&amp;image_by_post_id=' + post_id_hidden + '&amp;viewmode=single&amp;TB_iframe=1&amp;width=800&amp;height=' + boxViewportHeight + '" title="Crop-Thumbnail">Crop-Thumbnail</a>');
17
-
18
- /* dynamic way: after ajax change of the post thumbnail
19
- * extend the functionality of the base function "WPSetThumbnailHTML"
20
- */
21
- if ( typeof WPSetThumbnailHTML === 'function') {
22
- var cptWPSetThumbnailHTMLoriginal = WPSetThumbnailHTML;
23
- WPSetThumbnailHTML = function(html) {
24
- cptWPSetThumbnailHTMLoriginal(html);
25
- $('#remove-post-thumbnail').parent().parent().append('<a class="thickbox" href="' + ajaxurl + '?action=croppostthumb_ajax&amp;image_by_post_id=' + post_id_hidden + '&amp;viewmode=single&amp;TB_iframe=1&amp;width=800&amp;height=' + boxViewportHeight + '" title="Crop-Thumbnail">Crop-Thumbnail</a>');
26
- }
27
- }
28
- /** END add link to meta-box for post-thumbnails on posts and pages **/
29
  }
30
  }
31
 
@@ -42,3 +25,22 @@ jQuery(document).ready(function($) {
42
  });
43
  }
44
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  /** add link on top of editor **/
11
  $('#wp-content-media-buttons').append('<a style="margin:0 2em;" class="thickbox" href="' + ajaxurl + '?action=croppostthumb_ajax&amp;post_id=' + post_id_hidden + '&amp;TB_iframe=1&amp;width=800&amp;height=' + boxViewportHeight + '" title="Crop-Thumbnails">Crop-Thumbnails</a>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  }
13
  }
14
 
25
  });
26
  }
27
  });
28
+
29
+ /**
30
+ * this function is called from featured-images-meta-box.php which renders the meta-box for featured images
31
+ */
32
+ function cptCheck_SetFeaturedImage() {
33
+ $ = jQuery;
34
+ if ($('body.post-php, body.page-php, body.page-new.php, body.post-new-php').length > 0) {
35
+ var meta_box = $('#select-featured-image');
36
+
37
+ //write new
38
+ $('.cptCropThumbnailFeaturedImageLink').remove();
39
+ if(meta_box.hasClass('has-featured-image')) {
40
+ var post_id_hidden = parseInt(meta_box.data('post-id'));
41
+ var thumb_id_hidden = parseInt(meta_box.find('input[name="thumbnail_id"]').attr('value'));
42
+ var boxViewportHeight = $(window).height() - 100;
43
+ meta_box.append('<a class="thickbox button-secondary cptCropThumbnailFeaturedImageLink" href="' + ajaxurl + '?action=croppostthumb_ajax&amp;image_id=' + thumb_id_hidden + '&amp;parent_post_id=' +post_id_hidden+ '&amp;viewmode=single&amp;TB_iframe=1&amp;width=800&amp;height=' + boxViewportHeight + '" title="Crop-Thumbnail" style="margin-top:10px">Crop-Thumbnail</a>');
44
+ }
45
+ }
46
+ }
js/vers-0-7-0/cpt-crop.js ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+ var pluginpath = '../wp-content/plugins/crop-thumbnails';
3
+ var adminAjaxPath = '../wp-admin/admin-ajax.php';
4
+
5
+ //setup for ajax connections
6
+ $.ajaxSetup({type:'POST', url:adminAjaxPath, cache:false, timeout: (30 * 1000)});
7
+
8
+ //cropping object: holds jcrop-object and image to use the crop on
9
+ var cropping = {api:-1, img : $('.selectionArea img')};
10
+
11
+ /*needed cause the js-logic is currently not handle the hidden objects in dependence with "select all of the same ratio"*/
12
+ $('.thumbnail-list li.hidden').remove();
13
+
14
+ cropping.img.fadeTo(0, 0.3);
15
+
16
+ //handle click on an entry
17
+ $('.thumbnail-list li').click(function() {
18
+ selectAllWithSameRatio($(this));
19
+ activateArea(cropping);
20
+ });
21
+
22
+
23
+ //handle checkbox for selecting all with same ratio
24
+ $('#cpt-same-ratio').change(function() {
25
+ var active = $('.thumbnail-list li.active');
26
+ if($(this).attr('checked')==='checked') {
27
+ if(active.length>0) {
28
+ selectAllWithSameRatio($(active[0]));
29
+ activateArea(cropping);
30
+ }
31
+ } else {
32
+ if(active.length>1) {
33
+ $('.thumbnail-list li').removeClass('active');
34
+ deactivateArea(cropping);
35
+ }
36
+ }
37
+ });
38
+
39
+
40
+ $('#cpt-deselect').click(function() {
41
+ $('.thumbnail-list li.active').removeClass('active');
42
+ deactivateArea(cropping);
43
+ });
44
+
45
+
46
+ $('#cpt-generate').click(function() {
47
+ var active = $('.thumbnail-list li.active');
48
+ if(active.length===0) {
49
+ alert(cpt_lang['selectOne']);
50
+ return;
51
+ }
52
+ var selection = cropping.api.tellSelect();
53
+ if(active.length>0 && selection.w>0 && selection.h>0) {
54
+ doProcessing(active,cropping);
55
+ }
56
+ });
57
+
58
+ /********************************/
59
+ function doProcessing(active,cropping) {
60
+ /*console.log('doProcessing');*/
61
+
62
+ var active_array = new Array();
63
+ active.find('img').each(function() {
64
+ active_array.push($(this).data('values'));
65
+ });
66
+
67
+ $('.mainWindow').hide();
68
+ $('.waitingWindow').show();
69
+
70
+ /*console.log('selection',cropping.api.tellSelect());*/
71
+
72
+ $.ajax({
73
+ data:{
74
+ action: 'cptSaveThumbnail',
75
+ '_ajax_nonce': cpt_ajax_nonce,
76
+ cookie: encodeURIComponent(document.cookie),
77
+ selection: JSON.stringify(cropping.api.tellSelect()),
78
+ raw_values: JSON.stringify(cropping.img.data('values')),
79
+ active_values: JSON.stringify(active_array)
80
+ },
81
+ complete : function() {
82
+ $('.mainWindow').show();
83
+ $('.waitingWindow').hide();
84
+ },
85
+ success : function( response ) {
86
+ var result = JSON.parse(response);
87
+ /*console.log(result);*/
88
+ if(typeof result.success == "number") {
89
+
90
+ if(result.changed_image_format) {
91
+ window.location.reload();
92
+ } else {
93
+ doCacheBreaker(result.success);
94
+ }
95
+ } else {
96
+ //saving fail
97
+ alert(result.error);
98
+ }
99
+ }
100
+ });
101
+ }
102
+
103
+ function doCacheBreaker(number) {
104
+ $('.thumbnail-list li img').each(function() {
105
+ var imgurl = $(this).attr('src');
106
+ var last = imgurl.lastIndexOf('?');
107
+ if(last<0) {
108
+ imgurl+='?'+number;
109
+ } else {
110
+ imgurl = imgurl.substring(0, last) + '?'+number;
111
+ }
112
+ $(this).attr('src',imgurl);
113
+ });
114
+ }
115
+
116
+ function selectAllWithSameRatio(elem) {
117
+ $('.thumbnail-list li').removeClass('active');
118
+ if($('#cpt-same-ratio').attr('checked')==='checked') {
119
+ var ratio = elem.attr('rel');
120
+ var elements = $('.thumbnail-list li[rel="'+ratio+'"]');
121
+ elements.addClass('active');
122
+ } else {
123
+ elem.addClass('active');
124
+ }
125
+ }
126
+
127
+
128
+ function deactivateArea(c) {
129
+ if(c.api!=-1) {
130
+ c.api.destroy();
131
+ }
132
+ }
133
+
134
+ function activateArea(c,li) {
135
+ deactivateArea(c);
136
+ var allActiveThumbs = $('.thumbnail-list li.active img');
137
+ var largestWidth = 0;
138
+ var largestHeight = 0;
139
+ var ratio = 0;
140
+ allActiveThumbs.each(function() {
141
+ if(ratio === 0) {
142
+ ratio = $(this).data('values').ratio;//initial
143
+ }
144
+ if(ratio != $(this).data('values').ratio) {
145
+ alert(cpt_lang['bug']);
146
+ }
147
+
148
+ //we only need to check in one dimension, cause per definition all images have to use the same ratio
149
+ if($(this).data('values').width > largestWidth) {
150
+ largestWidth = $(this).data('values').width;
151
+ largestHeight = $(this).data('values').height;
152
+ }
153
+ });
154
+
155
+
156
+ var scale = c.img.width() / largestWidth;
157
+ var preSelect = [ 0, 0, Math.round(scale*c.img.width()), Math.round(scale*c.img.height()) ];
158
+ var minSize = [ largestWidth, largestHeight ];
159
+
160
+
161
+
162
+ var options = {}
163
+ options.boxWidth = c.img.width();
164
+ options.boxHeight = c.img.height();
165
+ options.trueSize = [cropping.img.data('values').width,c.img.data('values').height];
166
+ options.aspectRatio = ratio;
167
+ options.setSelect = preSelect;
168
+ if(largestWidth>cropping.img.data('values').width || largestHeight>cropping.img.data('values').height) {
169
+ alert(cpt_lang['warningOriginalToSmall']);
170
+ if(ratio>=0) {
171
+ options.setSelect = [ 0, 0, cropping.img.data('values').width, Math.round(scale*c.img.height()) ];
172
+ } else {
173
+ options.setSelect = [ 0, 0, Math.round(scale*c.img.width()) , cropping.img.data('values').height];
174
+ }
175
+ } else {
176
+ options.minSize = minSize;
177
+ }
178
+ //console.log('options',options);
179
+
180
+ c.api = $.Jcrop(c.img, options);
181
+ }
182
+ });
js/vers-0-7-0/cpt-main.js ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* functionality till version 0.7.0 */
2
+ jQuery(document).ready(function($) {
3
+ var boxViewportHeight = $(window).height() - 100;
4
+ //add link on posts and pages
5
+ if ($('body.post-php, body.page-php, body.page-new.php, body.post-new-php').length > 0) {
6
+ var post_id_hidden = $('form#post #post_ID');
7
+ if (post_id_hidden) {
8
+
9
+ post_id_hidden = parseInt(post_id_hidden.val());
10
+
11
+ /** add link on top of editor **/
12
+ $('#wp-content-media-buttons').append('<a style="margin:0 2em;" class="thickbox" href="' + ajaxurl + '?action=croppostthumb_ajax&amp;post_id=' + post_id_hidden + '&amp;TB_iframe=1&amp;width=800&amp;height=' + boxViewportHeight + '" title="Crop-Thumbnails">Crop-Thumbnails</a>');
13
+
14
+
15
+ /** add link to meta-box for post-thumbnails on posts and pages **/
16
+ /* static way: after reload of the page */
17
+ $('#remove-post-thumbnail').parent().parent().append('<a class="thickbox" href="' + ajaxurl + '?action=croppostthumb_ajax&amp;image_by_post_id=' + post_id_hidden + '&amp;viewmode=single&amp;TB_iframe=1&amp;width=800&amp;height=' + boxViewportHeight + '" title="Crop-Thumbnail">Crop-Thumbnail</a>');
18
+
19
+ /* dynamic way: after ajax change of the post thumbnail
20
+ * extend the functionality of the base function "WPSetThumbnailHTML"
21
+ */
22
+ if ( typeof WPSetThumbnailHTML === 'function') {
23
+ var cptWPSetThumbnailHTMLoriginal = WPSetThumbnailHTML;
24
+ WPSetThumbnailHTML = function(html) {
25
+ cptWPSetThumbnailHTMLoriginal(html);
26
+ $('#remove-post-thumbnail').parent().parent().append('<a class="thickbox" href="' + ajaxurl + '?action=croppostthumb_ajax&amp;image_by_post_id=' + post_id_hidden + '&amp;viewmode=single&amp;TB_iframe=1&amp;width=800&amp;height=' + boxViewportHeight + '" title="Crop-Thumbnail">Crop-Thumbnail</a>');
27
+ }
28
+ }
29
+ /** END add link to meta-box for post-thumbnails on posts and pages **/
30
+ }
31
+ }
32
+
33
+ /** add link on mediathek **/
34
+ if ($('body.upload-php').length > 0) {
35
+
36
+ $('#the-list tr').each(function() {
37
+ if ($(this).find('td.media-icon img').attr('src').lastIndexOf("/wp-includes/images/") == -1) {
38
+ var post_id = parseInt($(this).attr('id').substr(5));
39
+ var last_span = $(this).find('.column-title .row-actions span:last-child');
40
+ last_span.append(' | ');
41
+ last_span.parent().append('<a class="thickbox" href="' + ajaxurl + '?action=croppostthumb_ajax&amp;image_id=' + post_id + '&amp;viewmode=single&amp;TB_iframe=1&amp;width=800&amp;height=' + boxViewportHeight + '" title="Crop-Thumbnail">Crop-Thumbnail</a>')
42
+ }
43
+ });
44
+ }
45
+ });
lang/cpt_lang-pt_BR.mo ADDED
Binary file
lang/cpt_lang-pt_BR.po ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Crop Thumbnails v0.7.0\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2012-11-25 20:45:12+0000\n"
7
+ "Last-Translator: admin <rose@gaiabrasil.com.br>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-Language: Portuguese\n"
14
+ "X-Poedit-Country: BRAZIL\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
17
+ "X-Poedit-Basepath: ../\n"
18
+ "X-Poedit-Bookmarks: \n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+ "X-Textdomain-Support: yes"
21
+
22
+ #: crop-thumbnails.php:35
23
+ #@ default
24
+ msgid "Crop your thumbnails, the easy way."
25
+ msgstr ""
26
+
27
+ #: functions/editor.php:52
28
+ #@ cpt_lang
29
+ msgid "An error happend!"
30
+ msgstr "Ocorreu um erro!"
31
+
32
+ #: functions/editor.php:76
33
+ #: functions/editor.php:196
34
+ #@ cpt_lang
35
+ msgid "Cropping is disabled for this post-type."
36
+ msgstr "O corte está desativado para este tipo de post."
37
+
38
+ #: functions/editor.php:78
39
+ #@ cpt_lang
40
+ msgid "No images in this post yet. You have to upload some via upload dialog."
41
+ msgstr "Não há imagens neste post ainda. Você tem que carregar alguma através da caixa de diálogo de upload."
42
+
43
+ #: functions/editor.php:101
44
+ #@ cpt_lang
45
+ msgid "Choose the image you want to crop."
46
+ msgstr "Escolha a imagem que você deseja cortar."
47
+
48
+ #: functions/editor.php:107
49
+ #@ cpt_lang
50
+ msgid "Post Thumbnail"
51
+ msgstr "Publicar Miniatura"
52
+
53
+ #: functions/editor.php:107
54
+ #, php-format
55
+ #@ cpt_lang
56
+ msgid "Image %d"
57
+ msgstr "Imagem %d"
58
+
59
+ #: functions/editor.php:173
60
+ #@ cpt_lang
61
+ msgid "bug - this case shouldnt be happend"
62
+ msgstr "bug - isso não devia ter acontececido"
63
+
64
+ #: functions/editor.php:174
65
+ #@ cpt_lang
66
+ msgid "Warning: the original image is to small to be cropped in good quality with this thumbnail-size."
67
+ msgstr "Atenção: a imagem original é muito pequena para ser cortada em boa qualidade neste tamanho de miniatura."
68
+
69
+ #: functions/editor.php:175
70
+ #@ cpt_lang
71
+ msgid "First, select one image. Then, click once again."
72
+ msgstr "Primeiro, selecione uma imagem. Em seguida, clique novamente."
73
+
74
+ #: functions/editor.php:201
75
+ #@ cpt_lang
76
+ msgid "back to image-list"
77
+ msgstr "volte a lista de imagens"
78
+
79
+ #: functions/editor.php:202
80
+ #@ cpt_lang
81
+ msgid "Please wait until the Images are cropped."
82
+ msgstr "Por favor, aguarde até que as imagens sejam cortadas."
83
+
84
+ #: functions/editor.php:205
85
+ #@ cpt_lang
86
+ msgid "Raw"
87
+ msgstr "Bruta"
88
+
89
+ #: functions/editor.php:205
90
+ #: functions/editor.php:246
91
+ #@ cpt_lang
92
+ msgid "pixel"
93
+ msgstr "pixel"
94
+
95
+ #: functions/editor.php:207
96
+ #@ cpt_lang
97
+ msgid "save crop"
98
+ msgstr "cortar e salvar"
99
+
100
+ #: functions/editor.php:208
101
+ #@ cpt_lang
102
+ msgid "Quick-Instructions"
103
+ msgstr "Instruções rápidas"
104
+
105
+ #: functions/editor.php:210
106
+ #@ cpt_lang
107
+ msgid "Step 1: Choose an image from the right."
108
+ msgstr "Passo 1: Escolha uma imagem à direita."
109
+
110
+ #: functions/editor.php:211
111
+ #@ cpt_lang
112
+ msgid "Step 2: Use the mouse change the size of the rectangle on the image above."
113
+ msgstr "Passo 2: Use o mouse para alterar o tamanho do retângulo na imagem acima."
114
+
115
+ #: functions/editor.php:212
116
+ #@ cpt_lang
117
+ msgid "Step 3: Click on \"save crop\"."
118
+ msgstr "Passo 3: Clique em \"cortar e salvar\"."
119
+
120
+ #: functions/editor.php:217
121
+ #@ cpt_lang
122
+ msgid "select images with same ratio at once"
123
+ msgstr "selecionar imagens com mesma proporção de uma só vez"
124
+
125
+ #: functions/editor.php:218
126
+ #@ cpt_lang
127
+ msgid "deselect all"
128
+ msgstr "desmarcar todos"
129
+
130
+ #: functions/editor.php:230
131
+ #@ cpt_lang
132
+ msgid "cropped"
133
+ msgstr "cortadas"
134
+
135
+ #: functions/editor.php:240
136
+ #@ cpt_lang
137
+ msgid "Original image to small for good crop-quality!"
138
+ msgstr "Imagem original muito pequena para um corte de qualidade!"
139
+
140
+ #: functions/editor.php:246
141
+ #@ cpt_lang
142
+ msgid "Dimensions:"
143
+ msgstr "Dimensões:"
144
+
145
+ #: functions/editor.php:247
146
+ #@ cpt_lang
147
+ msgid "Ratio:"
148
+ msgstr "Relação:"
149
+
150
+ #: functions/save.php:95
151
+ #, php-format
152
+ #@ cpt_lang
153
+ msgid "Cant generate filesize \"%s\"."
154
+ msgstr "Não é possível gerar o tamanho \"%s\"."
155
+
156
+ #: functions/save.php:102
157
+ #@ cpt_lang
158
+ msgid "Cant copy temporary file to media-library."
159
+ msgstr "Não é possível copiar arquivo temporário para a biblioteca de mídia."
160
+
161
+ #: functions/save.php:106
162
+ #@ cpt_lang
163
+ msgid "Cant delete temporary file."
164
+ msgstr "Não é possível excluir arquivo temporário."
165
+
166
+ #: functions/save.php:172
167
+ #@ cpt_lang
168
+ msgid "ERROR: Security Check failed (maybe a timeout - please try again)."
169
+ msgstr "ERRO: Verificação de Segurança falhou (talvez pelo tempo limite ter sido atingido - por favor, tente novamente)."
170
+
171
+ #: functions/save.php:176
172
+ #@ cpt_lang
173
+ msgid "ERROR: Submitted data are not complete."
174
+ msgstr "ERRO: dados apresentados são estão completos."
175
+
176
+ #: functions/save.php:184
177
+ #@ cpt_lang
178
+ msgid "A cropping with this dimensions on these Image ist not possible."
179
+ msgstr "Um corte com estas dimensões sobre esta imagen não é possível."
180
+
181
+ #: functions/save.php:195
182
+ #@ cpt_lang
183
+ msgid "ERROR: Can`t find original Image in Database!"
184
+ msgstr "ERRO: Não é possível localizar a imagem original no banco de dados!"
185
+
186
+ #: functions/save.php:198
187
+ #@ cpt_lang
188
+ msgid "ERROR: Can`t find original Imagefile!"
189
+ msgstr "ERRO: Não é possível encontrar arquivo de imagem original!"
190
+
191
+ #: functions/save.php:201
192
+ #@ cpt_lang
193
+ msgid "ERROR: Can`t find original Image-Metadata!"
194
+ msgstr "ERRO: Não é possível encontrar imagem original Metadados!"
195
+
196
+ #: functions/settings.php:16
197
+ #@ cpt_lang
198
+ msgid "Settings"
199
+ msgstr "Configurações"
200
+
201
+ #: functions/settings.php:23
202
+ #@ cpt_lang
203
+ msgid "Crop Post Thumbnail Page"
204
+ msgstr "Cortar miniaturas na página do post"
205
+
206
+ #: functions/settings.php:23
207
+ #@ cpt_lang
208
+ msgid "Crop Thumbnails"
209
+ msgstr "Cortar miniaturas"
210
+
211
+ #: functions/settings.php:30
212
+ #@ cpt_lang
213
+ msgid "Crop Thumbnails - Settings"
214
+ msgstr "Cortar miniaturas - Configurações"
215
+
216
+ #: functions/settings.php:35
217
+ #@ cpt_lang
218
+ msgid "Save Changes"
219
+ msgstr "Salvar mudanças"
220
+
221
+ #: functions/settings.php:39
222
+ #@ cpt_lang
223
+ msgid "Support the plugin-author"
224
+ msgstr "Apoiar o autor do plugin"
225
+
226
+ #: functions/settings.php:40
227
+ #@ cpt_lang
228
+ msgid "You can support the plugin-author <br />(and let him know you love this plugin) <br />by donating via Paypal. Thanks a lot!"
229
+ msgstr "Você pode apoiar o autor do plugin <br />(e deixá-lo saber que você ama este plugin)<br /> doando via Paypal. Muito obrigado!"
230
+
231
+ #: functions/settings.php:60
232
+ #@ cpt_lang
233
+ msgid "Sizes and Posttypes"
234
+ msgstr "Tamanhos e Tipos de Post"
235
+
236
+ #: functions/settings.php:61
237
+ #@ cpt_lang
238
+ msgid "Choose the image-sizes you want to hide. Choose a post-type to prevent any use of the plugin for these entries."
239
+ msgstr "Escolha os tamanhos de imagem que você deseja esconder. Escolha um tipo de post para evitar qualquer uso do plugin para essas entradas."
240
+
241
+ #: functions/settings.php:66
242
+ #@ cpt_lang
243
+ msgid "Crop-Thumbnails is created to make cropping easy for the user. Often times the user only need to crop one, in dependence of the post-type. But the system will create also all other sizes. So, here you can select for what post-type what sizes should be visible in the plugin interface."
244
+ msgstr "Crop-Thumbnails é criado para fazer recorte fácil para o usuário. Muitas vezes o utilizador necessita somente de um recorte, pois depende dele em seu post. Mas o sistema irá criar também todos os outros tamanhos. Então, aqui você pode selecionar para que as miniaturas de seu post sejam visíveis na interface do plugin."
245
+
246
+ #: functions/settings.php:67
247
+ #@ cpt_lang
248
+ msgid "Crop-Thumbnails will only show croped images - sizes with no crop will always be hidden."
249
+ msgstr "Crop-Thumbnails só irá mostrar imagens cortadas - tamanhos sem cortes serão sempre escondidos."
250
+
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: volkmar-kantor
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=volkmar%2ekantor%40gmx%2ede&lc=DE&item_name=Volkmar%20Kantor%20%2d%20totalmedial%2ede&item_number=crop%2dthumbnails&no_note=0&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
4
  Tags: post-thumbnails, images, media library
5
  Requires at least: 3.1
6
- Tested up to: 3.4
7
  Stable tag: trunk
8
  License: GPL v3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -30,19 +30,24 @@ You can use the built in installer and upgrader, or you can install the plugin m
30
 
31
  = What languages are supported? =
32
  * English
33
- * German
 
34
 
35
  = I have cropped the image but the old one is used on the page. =
36
  If you had viewed your image on the site before, your browser has cached the image. Go tell them to reload the fresh image from the server by hitting "F5".
37
 
 
 
 
 
38
  = Is it possible to crop an non-cropped image-size? =
39
  Currently not.
40
 
41
  = What ideas for further releases you have? =
42
  * allow cropping window in frontside
43
- * allow not cropped image-sizes
44
- * allow new crop sizes beside the ones added with the add_image_size() function
45
- * reset standard image
46
 
47
  == Screenshots ==
48
 
@@ -53,6 +58,12 @@ Currently not.
53
  5. Choose what image-sizes should be hidden (for what post-types), for better usability.
54
 
55
  == Changelog ==
 
 
 
 
 
 
56
  = 0.7.0 =
57
  * workflow-enhancement: change the way the plugin handled same image-ratios (faster editing and less warnings)
58
  * the image-size with the biggest dimensions now is used for the min-boundaries (jcrop)
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=volkmar%2ekantor%40gmx%2ede&lc=DE&item_name=Volkmar%20Kantor%20%2d%20totalmedial%2ede&item_number=crop%2dthumbnails&no_note=0&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
4
  Tags: post-thumbnails, images, media library
5
  Requires at least: 3.1
6
+ Tested up to: 3.5
7
  Stable tag: trunk
8
  License: GPL v3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
30
 
31
  = What languages are supported? =
32
  * English
33
+ * German (de_DE)
34
+ * brazilian portuguese (pt_BR) - thanks to Alex Meusburger
35
 
36
  = I have cropped the image but the old one is used on the page. =
37
  If you had viewed your image on the site before, your browser has cached the image. Go tell them to reload the fresh image from the server by hitting "F5".
38
 
39
+ = I have cropped the image but in the featured-image box in the editor the croped version dont show up =
40
+ Refresh or Update the editor page.
41
+ Note that the image in the featured-image box will only be a preview, to show what image is choosed. The theme defines what image-size is used on the front-end.
42
+
43
  = Is it possible to crop an non-cropped image-size? =
44
  Currently not.
45
 
46
  = What ideas for further releases you have? =
47
  * allow cropping window in frontside
48
+ * allow new crop sizes beside the ones added with the add_image_size() function (for using less disk space)
49
+ * reset standard image-crop
50
+ * let the user generate all image-sizes at once by define a "central point of interest"
51
 
52
  == Screenshots ==
53
 
58
  5. Choose what image-sizes should be hidden (for what post-types), for better usability.
59
 
60
  == Changelog ==
61
+ = 0.7.1 =
62
+ * add language: brazilian portuguese (pt_br)
63
+ * bug fix: fixes for the upcoming Wordpress 3.5
64
+ * bug fix: in crop editor, if an original image is larger than a single selected image-size, the predefined selection will now be on maximum possible size
65
+ * bug fix: ensure that other plugins can´t add styles and scripts into the crop-thumbnail-iframe
66
+
67
  = 0.7.0 =
68
  * workflow-enhancement: change the way the plugin handled same image-ratios (faster editing and less warnings)
69
  * the image-size with the biggest dimensions now is used for the min-boundaries (jcrop)