Version Description
- WordPress 3.9 compatibility issues fixed
- Removed randomly floated 'Maximum upload file size'
Download this release
Release Info
Developer | tomasz.sita |
Plugin | 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 +4 -0
- lib/ManualImageCrop.php +25 -25
- manual-image-crop.php +3 -2
- readme.txt +12 -7
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( '
|
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('.
|
94 |
-
jQuery('.details .edit-attachment').after( '<a class="thickbox mic-link
|
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 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
|
|
|
|
|
|
122 |
}
|
123 |
-
}
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
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> ' );
|
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.
|
7 |
Author: Tomasz Sita
|
8 |
Author URI: http://www.rocketmill.co.uk/author/tomasz
|
|
|
9 |
License: GPL2
|
10 |
*/
|
11 |
|
12 |
-
define('mic_VERSION', '1.
|
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.
|
6 |
License: GPLv2 or later
|
7 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
-
|
|
|
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 |
-
|
27 |
-
|
28 |
|
29 |
Automatically:
|
30 |
-
|
31 |
-
|
32 |
-
|
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
|