diff --git a/assets/css/mic-admin.css b/assets/css/mic-admin.css index 48e1bc5..51d650b 100644 --- a/assets/css/mic-admin.css +++ b/assets/css/mic-admin.css @@ -98,4 +98,67 @@ .mic-option { margin-top: 10px; +} + +.attachment-info .mic-link.crop-image { + display: block; + text-decoration: none; + white-space: nowrap; +} + +.attachment-info .mic-link.crop-image { + display: block; + text-decoration: none; + white-space: nowrap; +} + +.mic-editor-wrapper h2 .nav-tab { + font-weight: 400; + font-size: 14px; + padding: 6px 12px; + + color: #21759b; + background: none; + border: none; +} + +.mic-editor-wrapper h2 .nav-tab:hover { + color: #d54e21; +} + +.mic-editor-wrapper h2 .nav-tab-active { + color: #32373c; + background: #fff; + border: 1px solid #ddd; + border-bottom: none; +} + +.mic-editor-wrapper h2 .nav-tab-active:hover { + color: #32373c; +} + +.widefat.mic-table th { + padding: 8px 10px; + font-weight: 400; +} + +.mic-table { + max-width: 1000px; +} + +th.mic-size { + width: auto; +} +th.mic-visible { + width: 120px; +} +th.mic-quality { + width: 300px; +} +th.mic-label { + width: 240px; +} + +td.mic-size { + font-weight: 700; } \ No newline at end of file diff --git a/assets/js/microp.js b/assets/js/microp.js index f6046f0..9db6cce 100644 --- a/assets/js/microp.js +++ b/assets/js/microp.js @@ -66,4 +66,17 @@ jQuery(document).ready(function($) { setInterval(adjustMicWindowSize, 200); + // Prompt to crop featured images automatically, if set in settings page + if ( typeof mic_autocrop_uploads != 'undefined' && typeof wp.Uploader != 'undefined' ) { + // When the uploader receives a new image, invoke the crop feature. + $.extend( wp.Uploader.prototype, { + success : function( file_attachment ){ + if ( file_attachment.id ) { + var crop_url = '/wp-admin/admin-ajax.php?action=mic_editor_window&postId=' + file_attachment.id; + tb_show( mic_autocrop_uploads, crop_url ); + } + } + }); + } + }); \ No newline at end of file diff --git a/lib/ManualImageCrop.php b/lib/ManualImageCrop.php index a7b9466..3a3581c 100644 --- a/lib/ManualImageCrop.php +++ b/lib/ManualImageCrop.php @@ -29,7 +29,7 @@ private function __construct() { public function enqueueAssets() { add_thickbox(); - wp_register_style( 'rct-admin', plugins_url('assets/css/mic-admin.css', dirname( __FILE__ ) ) ); + wp_register_style( 'rct-admin', plugins_url('assets/css/mic-admin.css', dirname( __FILE__ ) ), array(), mic_VERSION ); wp_enqueue_style( 'rct-admin' ); wp_register_style( 'jquery-jcrop', plugins_url('assets/css/jquery.Jcrop.min.css', dirname( __FILE__ ) ) ); @@ -37,7 +37,7 @@ public function enqueueAssets() { wp_enqueue_script( 'jquery-color', plugins_url('assets/js/jquery.color.js', dirname( __FILE__ )), array( 'jquery') ); wp_enqueue_script( 'jquery-jcrop', plugins_url('assets/js/jquery.Jcrop.min.js', dirname( __FILE__ )), array( 'jquery') ); - wp_enqueue_script( 'miccrop', plugins_url('assets/js/microp.js', dirname( __FILE__ )), array( 'jquery') ); + wp_enqueue_script( 'miccrop', plugins_url('assets/js/microp.js', dirname( __FILE__ )), array( 'jquery'), mic_VERSION ); } /** @@ -84,16 +84,22 @@ public function addAttachementEditLink() { ?> + $plugin) { + if ( !is_plugin_active( $file ) ) continue; + + if ( $plugin['Name'] == $plugin_name ) return array('file' => $file, 'plugin' => $plugin); + else if ( $plugin['Title'] == $plugin_name ) return array('file' => $file, 'plugin' => $plugin); + } + + return false; +} + +/** + * Displays a message to the admin about conflicting plugins. + */ +function _mic_display_conflicting_plugin_error() { + global $mic_conflicting_plugins; + if ( empty($mic_conflicting_plugins) ) return; // Should not occur anyway, but let's ensure we are giving a meaningful error to the user. + + ?> +
+

+ + + +

Dismiss

+
+