Manual Image Crop - Version 1.05

Version Description

  • WordPress 3.9 compatibility issues fixed
  • Removed randomly floated 'Maximum upload file size'
Download this release

Release Info

Developer tomasz.sita
Plugin Icon 128x128 Manual Image Crop
Version 1.05
Comparing to
See all releases

Code changes from version 1.04 to 1.05

assets/css/mic-admin.css CHANGED
@@ -52,4 +52,8 @@
52
 
53
  #micSuccessMessage, #micFailureMessage {
54
  display: none;
 
 
 
 
55
  }
52
 
53
  #micSuccessMessage, #micFailureMessage {
54
  display: none;
55
+ }
56
+
57
+ .crop-image {
58
+ margin-right: 10px;
59
  }
lib/ManualImageCrop.php CHANGED
@@ -47,7 +47,7 @@ class ManualImageCrop {
47
  add_action( 'media_row_actions', array($this, 'addMediaEditorLinks'), 10, 2 );
48
  add_action( 'admin_post_thumbnail_html', array($this, 'addCropFeatureImageEditorLink'), 10, 2 );
49
  add_action( 'print_media_templates', array($this, 'addAttachementEditLink') );
50
- add_action( 'pre-upload-ui', array($this, 'addAfterUploadAttachementEditLink') );
51
  }
52
 
53
  /**
@@ -90,8 +90,8 @@ setInterval(function() {
90
  try {
91
  var mRegexp = /\?post=([0-9]+)/;
92
  var match = mRegexp.exec(jQuery('.details .edit-attachment').attr('href'));
93
- jQuery('.edit-attachment.crop-image').remove();
94
- jQuery('.details .edit-attachment').after( '<a class="thickbox mic-link edit-attachment crop-image" rel="crop" title="Manual Image Crop" href="' + ajaxurl + '?action=mic_editor_window&postId=' + match[1] + '">Crop Image</a>' );
95
  } catch (e) {
96
  console.log(e);
97
  }
@@ -106,29 +106,29 @@ setInterval(function() {
106
  * Adds link in the ligthbox media library
107
  */
108
  public function addAfterUploadAttachementEditLink() {
109
- ?>
110
- <script>
111
- var micEditAttachemtnLinkAdded = false;
112
- var micEditAttachemtnLinkAddedInterval = 0;
113
- jQuery(document).ready(function() {
114
- micEditAttachemtnLinkAddedInterval = setInterval(function() {
115
- if (jQuery('#media-items .edit-attachment').length) {
116
- jQuery('#media-items .edit-attachment').each(function(i, k) {
117
- try {
118
- var mRegexp = /\?post=([0-9]+)/;
119
- var match = mRegexp.exec(jQuery(this).attr('href'));
120
- if (!jQuery(this).parent().find('.edit-attachment.crop-image').length && jQuery(this).parent().find('.pinkynail').attr('src').match(/upload/g)) {
121
- jQuery(this).after( '<a class="thickbox mic-link edit-attachment crop-image" rel="crop" title="Manual Image Crop" href="' + ajaxurl + '?action=mic_editor_window&postId=' + match[1] + '">Crop Image</a>' );
 
 
 
122
  }
123
- } catch (e) {
124
- console.log(e);
125
- }
126
- });
127
- }
128
- }, 500);
129
- });
130
- </script>
131
- <?php
132
  }
133
 
134
  /**
47
  add_action( 'media_row_actions', array($this, 'addMediaEditorLinks'), 10, 2 );
48
  add_action( 'admin_post_thumbnail_html', array($this, 'addCropFeatureImageEditorLink'), 10, 2 );
49
  add_action( 'print_media_templates', array($this, 'addAttachementEditLink') );
50
+ add_action( 'admin_print_footer_scripts', array($this, 'addAfterUploadAttachementEditLink') );
51
  }
52
 
53
  /**
90
  try {
91
  var mRegexp = /\?post=([0-9]+)/;
92
  var match = mRegexp.exec(jQuery('.details .edit-attachment').attr('href'));
93
+ jQuery('.crop-image-ml.crop-image').remove();
94
+ jQuery('.details .edit-attachment').after( '<a class="thickbox mic-link crop-image crop-image-ml" rel="crop" title="Manual Image Crop" href="' + ajaxurl + '?action=mic_editor_window&postId=' + match[1] + '">Crop Image</a> ' );
95
  } catch (e) {
96
  console.log(e);
97
  }
106
  * Adds link in the ligthbox media library
107
  */
108
  public function addAfterUploadAttachementEditLink() {
109
+ ?>
110
+ <script>
111
+ var micEditAttachemtnLinkAdded = false;
112
+ var micEditAttachemtnLinkAddedInterval = 0;
113
+ jQuery(document).ready(function() {
114
+ micEditAttachemtnLinkAddedInterval = setInterval(function() {
115
+ if (jQuery('#media-items .edit-attachment').length) {
116
+ jQuery('#media-items .edit-attachment').each(function(i, k) {
117
+ try {
118
+ var mRegexp = /\?post=([0-9]+)/;
119
+ var match = mRegexp.exec(jQuery(this).attr('href'));
120
+ if (!jQuery(this).parent().find('.edit-attachment.crop-image').length && jQuery(this).parent().find('.pinkynail').attr('src').match(/upload/g)) {
121
+ jQuery(this).after( '<a class="thickbox mic-link edit-attachment crop-image" rel="crop" title="Manual Image Crop" href="' + ajaxurl + '?action=mic_editor_window&postId=' + match[1] + '">Crop Image</a>&nbsp;' );
122
+ }
123
+ } catch (e) {
124
+ console.log(e);
125
  }
126
+ });
127
+ }
128
+ }, 500);
129
+ });
130
+ </script>
131
+ <?php
 
 
 
132
  }
133
 
134
  /**
manual-image-crop.php CHANGED
@@ -3,13 +3,14 @@
3
  Plugin Name: Manual Image Crop
4
  Plugin URI: http://www.rocketmill.co.uk/wordpress-plugin-manual-image-crop
5
  Description: Plugin allows you to manually crop all the image sizes registered in your WordPress theme (in particular featured image). Simply click on the "Crop" link next to any image in your media library and select the area of the image you want to crop.
6
- Version: 1.04
7
  Author: Tomasz Sita
8
  Author URI: http://www.rocketmill.co.uk/author/tomasz
 
9
  License: GPL2
10
  */
11
 
12
- define('mic_VERSION', '1.04');
13
 
14
  include_once(dirname(__FILE__) . '/lib/ManualImageCrop.php');
15
  include_once(dirname(__FILE__) . '/lib/ManualImageCropEditorWindow.php');
3
  Plugin Name: Manual Image Crop
4
  Plugin URI: http://www.rocketmill.co.uk/wordpress-plugin-manual-image-crop
5
  Description: Plugin allows you to manually crop all the image sizes registered in your WordPress theme (in particular featured image). Simply click on the "Crop" link next to any image in your media library and select the area of the image you want to crop.
6
+ Version: 1.05
7
  Author: Tomasz Sita
8
  Author URI: http://www.rocketmill.co.uk/author/tomasz
9
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WB5ZQWGUM7T96
10
  License: GPL2
11
  */
12
 
13
+ define('mic_VERSION', '1.05');
14
 
15
  include_once(dirname(__FILE__) . '/lib/ManualImageCrop.php');
16
  include_once(dirname(__FILE__) . '/lib/ManualImageCropEditorWindow.php');
readme.txt CHANGED
@@ -2,10 +2,11 @@
2
  Contributors: tomasz.sita
3
  Tags: crop, cropping, thumbnail, featured image, gallery, images, picture, image, image area
4
  Requires at least: 3.0.1
5
- Tested up to: 3.7.1
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
- Stable tag: 1.04
 
9
 
10
  Plugin allows you to manually crop all the image sizes registered in your WordPress theme (in particular featured image).
11
 
@@ -23,17 +24,21 @@ Apart from media library list, the plugin adds links in few more places:
23
 
24
  == Installation ==
25
  Manually:
26
- 1. Upload `manual-image-crop` to the `/wp-content/plugins/` directory
27
- 2. Activate the plugin through the 'Plugins' menu in WordPress
28
 
29
  Automatically:
30
- 1. Navigate to the 'Plugins' menu inside of the wordpress wp-admin dashboard, and select AD NEW
31
- 2. Search for 'Manual Imag Crop', and click install
32
- 3. When the plugin has been installed, Click 'Activate'
33
 
34
 
35
  == Changelog ==
36
 
 
 
 
 
37
  = 1.04 =
38
  * Added remembering of the previously selected area after cropping the specific image size
39
  * Fixed the "wp_enqueue_script was called incorrectly" warning in the WP debug mode
2
  Contributors: tomasz.sita
3
  Tags: crop, cropping, thumbnail, featured image, gallery, images, picture, image, image area
4
  Requires at least: 3.0.1
5
+ Tested up to: 3.9
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WB5ZQWGUM7T96
9
+ Stable tag: 1.05
10
 
11
  Plugin allows you to manually crop all the image sizes registered in your WordPress theme (in particular featured image).
12
 
24
 
25
  == Installation ==
26
  Manually:
27
+ * Upload `manual-image-crop` to the `/wp-content/plugins/` directory
28
+ * Activate the plugin through the 'Plugins' menu in WordPress
29
 
30
  Automatically:
31
+ * Navigate to the 'Plugins' menu inside of the wordpress wp-admin dashboard, and select AD NEW
32
+ * Search for 'Manual Imag Crop', and click install
33
+ * When the plugin has been installed, Click 'Activate'
34
 
35
 
36
  == Changelog ==
37
 
38
+ = 1.05 =
39
+ * WordPress 3.9 compatibility issues fixed
40
+ * Removed randomly floated 'Maximum upload file size'
41
+
42
  = 1.04 =
43
  * Added remembering of the previously selected area after cropping the specific image size
44
  * Fixed the "wp_enqueue_script was called incorrectly" warning in the WP debug mode