Version Description
- [Fixed] Rename controller classes - http://www.advancedcustomfields.com/support/discussion/2363/fatal-error-after-update-to-3.2.6
- [Added] Add edit button to image / file fields
- [Fixed] WYSIWYG toolbar buttons dissapearing in HTML tab mode
Download this release
Release Info
Developer | elliotcondon |
Plugin | Advanced Custom Fields |
Version | 3.2.7 |
Comparing to | |
See all releases |
Code changes from version 3.2.6 to 3.2.7
- acf.php +9 -9
- core/controllers/everything_fields.php +1 -1
- core/controllers/field_group.php +1 -1
- core/controllers/field_groups.php +1 -1
- core/controllers/input.php +12 -6
- core/controllers/options_page.php +1 -1
- core/controllers/settings.php +1 -1
- core/controllers/upgrade.php +1 -1
- core/fields/file.php +38 -8
- core/fields/image.php +56 -14
- css/input.css +94 -37
- js/input-actions.js +60 -14
- readme.txt +5 -0
acf.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Advanced Custom Fields
|
4 |
Plugin URI: http://www.advancedcustomfields.com/
|
5 |
Description: Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress.Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker and more!
|
6 |
-
Version: 3.2.
|
7 |
Author: Elliot Condon
|
8 |
Author URI: http://www.elliotcondon.com/
|
9 |
License: GPL
|
@@ -47,7 +47,7 @@ class Acf
|
|
47 |
// vars
|
48 |
$this->path = plugin_dir_path(__FILE__);
|
49 |
$this->dir = plugins_url('',__FILE__);
|
50 |
-
$this->version = '3.2.
|
51 |
$this->upgrade_version = '3.2.5'; // this is the latest version which requires an upgrade
|
52 |
$this->cache = array(); // basic array cache to hold data throughout the page load
|
53 |
|
@@ -225,37 +225,37 @@ class Acf
|
|
225 |
{
|
226 |
// Settings
|
227 |
include_once('core/controllers/settings.php');
|
228 |
-
$this->settings = new
|
229 |
|
230 |
|
231 |
// upgrade
|
232 |
include_once('core/controllers/upgrade.php');
|
233 |
-
$this->upgrade = new
|
234 |
|
235 |
|
236 |
// field_groups
|
237 |
include_once('core/controllers/field_groups.php');
|
238 |
-
$this->field_groups = new
|
239 |
|
240 |
|
241 |
// field_group
|
242 |
include_once('core/controllers/field_group.php');
|
243 |
-
$this->field_group = new
|
244 |
|
245 |
|
246 |
// input
|
247 |
include_once('core/controllers/input.php');
|
248 |
-
$this->input = new
|
249 |
|
250 |
|
251 |
// options page
|
252 |
include_once('core/controllers/options_page.php');
|
253 |
-
$this->options_page = new
|
254 |
|
255 |
|
256 |
// everthing fields
|
257 |
include_once('core/controllers/everything_fields.php');
|
258 |
-
$this->everything_fields = new
|
259 |
}
|
260 |
|
261 |
|
3 |
Plugin Name: Advanced Custom Fields
|
4 |
Plugin URI: http://www.advancedcustomfields.com/
|
5 |
Description: Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress.Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker and more!
|
6 |
+
Version: 3.2.7
|
7 |
Author: Elliot Condon
|
8 |
Author URI: http://www.elliotcondon.com/
|
9 |
License: GPL
|
47 |
// vars
|
48 |
$this->path = plugin_dir_path(__FILE__);
|
49 |
$this->dir = plugins_url('',__FILE__);
|
50 |
+
$this->version = '3.2.7';
|
51 |
$this->upgrade_version = '3.2.5'; // this is the latest version which requires an upgrade
|
52 |
$this->cache = array(); // basic array cache to hold data throughout the page load
|
53 |
|
225 |
{
|
226 |
// Settings
|
227 |
include_once('core/controllers/settings.php');
|
228 |
+
$this->settings = new acf_settings($this);
|
229 |
|
230 |
|
231 |
// upgrade
|
232 |
include_once('core/controllers/upgrade.php');
|
233 |
+
$this->upgrade = new acf_upgrade($this);
|
234 |
|
235 |
|
236 |
// field_groups
|
237 |
include_once('core/controllers/field_groups.php');
|
238 |
+
$this->field_groups = new acf_field_groups($this);
|
239 |
|
240 |
|
241 |
// field_group
|
242 |
include_once('core/controllers/field_group.php');
|
243 |
+
$this->field_group = new acf_field_group($this);
|
244 |
|
245 |
|
246 |
// input
|
247 |
include_once('core/controllers/input.php');
|
248 |
+
$this->input = new acf_input($this);
|
249 |
|
250 |
|
251 |
// options page
|
252 |
include_once('core/controllers/options_page.php');
|
253 |
+
$this->options_page = new acf_options_page($this);
|
254 |
|
255 |
|
256 |
// everthing fields
|
257 |
include_once('core/controllers/everything_fields.php');
|
258 |
+
$this->everything_fields = new acf_everything_fields($this);
|
259 |
}
|
260 |
|
261 |
|
core/controllers/everything_fields.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
*-------------------------------------------------------------------------*/
|
11 |
|
12 |
|
13 |
-
class
|
14 |
{
|
15 |
|
16 |
var $parent;
|
10 |
*-------------------------------------------------------------------------*/
|
11 |
|
12 |
|
13 |
+
class acf_everything_fields
|
14 |
{
|
15 |
|
16 |
var $parent;
|
core/controllers/field_group.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*/
|
10 |
|
11 |
|
12 |
-
class
|
13 |
{
|
14 |
|
15 |
var $parent,
|
9 |
*/
|
10 |
|
11 |
|
12 |
+
class acf_field_group
|
13 |
{
|
14 |
|
15 |
var $parent,
|
core/controllers/field_groups.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
*-------------------------------------------------------------------------*/
|
11 |
|
12 |
|
13 |
-
class
|
14 |
{
|
15 |
|
16 |
var $parent,
|
10 |
*-------------------------------------------------------------------------*/
|
11 |
|
12 |
|
13 |
+
class acf_field_groups
|
14 |
{
|
15 |
|
16 |
var $parent,
|
core/controllers/input.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*/
|
10 |
|
11 |
|
12 |
-
class
|
13 |
{
|
14 |
|
15 |
var $parent,
|
@@ -498,6 +498,7 @@ class Input
|
|
498 |
// vars
|
499 |
$defaults = array(
|
500 |
'acf_action' => null,
|
|
|
501 |
);
|
502 |
|
503 |
$options = array_merge($defaults, wp_parse_args( wp_get_referer() ));
|
@@ -510,15 +511,18 @@ class Input
|
|
510 |
}
|
511 |
|
512 |
|
513 |
-
|
|
|
514 |
|
515 |
?>
|
516 |
<script type="text/javascript">
|
517 |
-
|
|
|
|
|
518 |
|
|
|
519 |
self.parent.tb_remove();
|
520 |
|
521 |
-
//}, 1000);
|
522 |
</script>
|
523 |
</head>
|
524 |
<body>
|
@@ -547,6 +551,7 @@ class Input
|
|
547 |
// vars
|
548 |
$defaults = array(
|
549 |
'acf_action' => null,
|
|
|
550 |
);
|
551 |
|
552 |
$options = array_merge($defaults, $_GET);
|
@@ -587,8 +592,9 @@ html.wp-toolbar {
|
|
587 |
|
588 |
$(document).ready( function(){
|
589 |
|
590 |
-
$('#media-single-form').append('<input type="hidden" name="acf_action" value="
|
591 |
-
|
|
|
592 |
});
|
593 |
|
594 |
})(jQuery);
|
9 |
*/
|
10 |
|
11 |
|
12 |
+
class acf_input
|
13 |
{
|
14 |
|
15 |
var $parent,
|
498 |
// vars
|
499 |
$defaults = array(
|
500 |
'acf_action' => null,
|
501 |
+
'acf_field' => '',
|
502 |
);
|
503 |
|
504 |
$options = array_merge($defaults, wp_parse_args( wp_get_referer() ));
|
511 |
}
|
512 |
|
513 |
|
514 |
+
// call the apropriate field action
|
515 |
+
do_action('acf_head-update_attachment-' . $options['acf_field']);
|
516 |
|
517 |
?>
|
518 |
<script type="text/javascript">
|
519 |
+
|
520 |
+
// reset global
|
521 |
+
self.parent.acf_edit_attachment = null;
|
522 |
|
523 |
+
// remove tb
|
524 |
self.parent.tb_remove();
|
525 |
|
|
|
526 |
</script>
|
527 |
</head>
|
528 |
<body>
|
551 |
// vars
|
552 |
$defaults = array(
|
553 |
'acf_action' => null,
|
554 |
+
'acf_field' => '',
|
555 |
);
|
556 |
|
557 |
$options = array_merge($defaults, $_GET);
|
592 |
|
593 |
$(document).ready( function(){
|
594 |
|
595 |
+
$('#media-single-form').append('<input type="hidden" name="acf_action" value="<?php echo $options['acf_action']; ?>" />');
|
596 |
+
$('#media-single-form').append('<input type="hidden" name="acf_field" value="<?php echo $options['acf_field']; ?>" />');
|
597 |
+
|
598 |
});
|
599 |
|
600 |
})(jQuery);
|
core/controllers/options_page.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
*-------------------------------------------------------------------------*/
|
11 |
|
12 |
|
13 |
-
class
|
14 |
{
|
15 |
|
16 |
var $parent;
|
10 |
*-------------------------------------------------------------------------*/
|
11 |
|
12 |
|
13 |
+
class acf_options_page
|
14 |
{
|
15 |
|
16 |
var $parent;
|
core/controllers/settings.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*/
|
10 |
|
11 |
|
12 |
-
class
|
13 |
{
|
14 |
|
15 |
var $parent;
|
9 |
*/
|
10 |
|
11 |
|
12 |
+
class acf_settings
|
13 |
{
|
14 |
|
15 |
var $parent;
|
core/controllers/upgrade.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*/
|
10 |
|
11 |
|
12 |
-
class
|
13 |
{
|
14 |
|
15 |
var $parent;
|
9 |
*/
|
10 |
|
11 |
|
12 |
+
class acf_upgrade
|
13 |
{
|
14 |
|
15 |
var $parent;
|
core/fields/file.php
CHANGED
@@ -22,9 +22,38 @@ class acf_File extends acf_Field
|
|
22 |
add_action('admin_head-media-upload-popup', array($this, 'popup_head'));
|
23 |
add_action('wp_ajax_acf_select_file', array($this, 'ajax_select_file'));
|
24 |
add_filter('get_media_item_args', array($this, 'allow_file_insertion'));
|
|
|
25 |
}
|
26 |
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
/*--------------------------------------------------------------------------------------
|
29 |
*
|
30 |
* render_file
|
@@ -57,7 +86,8 @@ class acf_File extends acf_Field
|
|
57 |
</li>
|
58 |
<li>
|
59 |
<span class="acf-file-name"><?php echo $file_name[0]; ?></span><br />
|
60 |
-
<a href="
|
|
|
61 |
</li>
|
62 |
</ul>
|
63 |
<?php
|
@@ -154,17 +184,17 @@ class acf_File extends acf_Field
|
|
154 |
$class = $field['value'] ? "active" : "";
|
155 |
|
156 |
?>
|
157 |
-
<div class="
|
158 |
<input class="value" type="hidden" name="<?php echo $field['name']; ?>" value="<?php echo $field['value']; ?>" />
|
159 |
<div class="has-file">
|
160 |
<?php $this->render_file( $field['value'] ); ?>
|
161 |
</div>
|
162 |
<div class="no-file">
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
</div>
|
169 |
</div>
|
170 |
<?php
|
@@ -402,7 +432,7 @@ class acf_File extends acf_Field
|
|
402 |
self.parent.acf_div.closest('.repeater').find('.add-row-end').trigger('click');
|
403 |
|
404 |
// set acf_div to new row file
|
405 |
-
self.parent.acf_div = self.parent.acf_div.closest('.repeater').find('> table > tbody > tr:last-child .
|
406 |
}
|
407 |
else
|
408 |
{
|
22 |
add_action('admin_head-media-upload-popup', array($this, 'popup_head'));
|
23 |
add_action('wp_ajax_acf_select_file', array($this, 'ajax_select_file'));
|
24 |
add_filter('get_media_item_args', array($this, 'allow_file_insertion'));
|
25 |
+
add_action('acf_head-update_attachment-file', array($this, 'acf_head_update_attachment'));
|
26 |
}
|
27 |
|
28 |
|
29 |
+
/*
|
30 |
+
* acf_head_update_attachment
|
31 |
+
*
|
32 |
+
* @description:
|
33 |
+
* @since: 3.2.7
|
34 |
+
* @created: 4/07/12
|
35 |
+
*/
|
36 |
+
|
37 |
+
function acf_head_update_attachment()
|
38 |
+
{
|
39 |
+
?>
|
40 |
+
<script type="text/javascript">
|
41 |
+
(function($){
|
42 |
+
|
43 |
+
// vars
|
44 |
+
var div = self.parent.acf_edit_attachment;
|
45 |
+
|
46 |
+
|
47 |
+
// add message
|
48 |
+
self.parent.acf.add_message('File Updated.', div);
|
49 |
+
|
50 |
+
|
51 |
+
})(jQuery);
|
52 |
+
</script>
|
53 |
+
<?php
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
/*--------------------------------------------------------------------------------------
|
58 |
*
|
59 |
* render_file
|
86 |
</li>
|
87 |
<li>
|
88 |
<span class="acf-file-name"><?php echo $file_name[0]; ?></span><br />
|
89 |
+
<a href="#" class="edit-file"><?php _e('Edit','acf'); ?></a>
|
90 |
+
<a href="#" class="remove-file"><?php _e('Remove','acf'); ?></a>
|
91 |
</li>
|
92 |
</ul>
|
93 |
<?php
|
184 |
$class = $field['value'] ? "active" : "";
|
185 |
|
186 |
?>
|
187 |
+
<div class="acf-file-uploader <?php echo $class; ?>">
|
188 |
<input class="value" type="hidden" name="<?php echo $field['name']; ?>" value="<?php echo $field['value']; ?>" />
|
189 |
<div class="has-file">
|
190 |
<?php $this->render_file( $field['value'] ); ?>
|
191 |
</div>
|
192 |
<div class="no-file">
|
193 |
+
<ul class="hl clearfix">
|
194 |
+
<li>
|
195 |
+
<span class="acf-file-name"><?php _e('No File Selected','acf'); ?></span>. <a href="#" class="button add-file"><?php _e('Add File','acf'); ?></a>
|
196 |
+
</li>
|
197 |
+
</ul>
|
198 |
</div>
|
199 |
</div>
|
200 |
<?php
|
432 |
self.parent.acf_div.closest('.repeater').find('.add-row-end').trigger('click');
|
433 |
|
434 |
// set acf_div to new row file
|
435 |
+
self.parent.acf_div = self.parent.acf_div.closest('.repeater').find('> table > tbody > tr:last-child .acf-file-uploader');
|
436 |
}
|
437 |
else
|
438 |
{
|
core/fields/image.php
CHANGED
@@ -23,9 +23,37 @@ class acf_Image extends acf_Field
|
|
23 |
add_action('admin_head-media-upload-popup', array($this, 'popup_head'));
|
24 |
add_filter('get_media_item_args', array($this, 'allow_img_insertion'));
|
25 |
add_action('wp_ajax_acf_get_preview_image', array($this, 'acf_get_preview_image'));
|
|
|
26 |
}
|
27 |
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
/*--------------------------------------------------------------------------------------
|
30 |
*
|
31 |
* acf_get_preview_image
|
@@ -143,16 +171,29 @@ class acf_Image extends acf_Field
|
|
143 |
$file_src = wp_get_attachment_image_src($field['value'], $preview_size);
|
144 |
$file_src = $file_src[0];
|
145 |
|
146 |
-
if($file_src)
|
|
|
|
|
|
|
147 |
}
|
148 |
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
}
|
157 |
|
158 |
|
@@ -367,17 +408,18 @@ class acf_Image extends acf_Field
|
|
367 |
|
368 |
|
369 |
// get item
|
370 |
-
var item = json[0]
|
|
|
371 |
|
372 |
|
373 |
// update acf_div
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
|
378 |
|
379 |
// validation
|
380 |
-
|
381 |
|
382 |
|
383 |
// reset acf_div and return false
|
@@ -446,7 +488,7 @@ class acf_Image extends acf_Field
|
|
446 |
self.parent.acf_div.closest('.repeater').find('.add-row-end').trigger('click');
|
447 |
|
448 |
// set acf_div to new row image
|
449 |
-
self.parent.acf_div = self.parent.acf_div.closest('.repeater').find('> table > tbody > tr:last-child .
|
450 |
}
|
451 |
else
|
452 |
{
|
23 |
add_action('admin_head-media-upload-popup', array($this, 'popup_head'));
|
24 |
add_filter('get_media_item_args', array($this, 'allow_img_insertion'));
|
25 |
add_action('wp_ajax_acf_get_preview_image', array($this, 'acf_get_preview_image'));
|
26 |
+
add_action('acf_head-update_attachment-image', array($this, 'acf_head_update_attachment'));
|
27 |
}
|
28 |
|
29 |
|
30 |
+
/*
|
31 |
+
* acf_head_update_attachment
|
32 |
+
*
|
33 |
+
* @description:
|
34 |
+
* @since: 3.2.7
|
35 |
+
* @created: 4/07/12
|
36 |
+
*/
|
37 |
+
|
38 |
+
function acf_head_update_attachment()
|
39 |
+
{
|
40 |
+
?>
|
41 |
+
<script type="text/javascript">
|
42 |
+
(function($){
|
43 |
+
|
44 |
+
// vars
|
45 |
+
var div = self.parent.acf_edit_attachment;
|
46 |
+
|
47 |
+
|
48 |
+
// add message
|
49 |
+
self.parent.acf.add_message('Image Updated.', div);
|
50 |
+
|
51 |
+
|
52 |
+
})(jQuery);
|
53 |
+
</script>
|
54 |
+
<?php
|
55 |
+
}
|
56 |
+
|
57 |
/*--------------------------------------------------------------------------------------
|
58 |
*
|
59 |
* acf_get_preview_image
|
171 |
$file_src = wp_get_attachment_image_src($field['value'], $preview_size);
|
172 |
$file_src = $file_src[0];
|
173 |
|
174 |
+
if($file_src)
|
175 |
+
{
|
176 |
+
$class = "active";
|
177 |
+
}
|
178 |
}
|
179 |
|
180 |
+
?>
|
181 |
+
<div class="acf-image-uploader clearfix <?php echo $class; ?>" data-preview_size="<?php echo $preview_size; ?>">
|
182 |
+
<input class="value" type="hidden" name="<?php echo $field['name']; ?>" value="<?php echo $field['value']; ?>" />
|
183 |
+
<div class="has-image">
|
184 |
+
<div class="hover">
|
185 |
+
<ul class="bl">
|
186 |
+
<li><a class="remove-image ir" href="#">Remove</a></li>
|
187 |
+
<li><a class="edit-image ir" href="#">Edit</a></li>
|
188 |
+
</ul>
|
189 |
+
</div>
|
190 |
+
<img src="<?php echo $file_src; ?>" alt=""/>
|
191 |
+
</div>
|
192 |
+
<div class="no-image">
|
193 |
+
<p><?php _e('No image selected','acf'); ?> <input type="button" class="button add-image" value="<?php _e('Add Image','acf'); ?>" />
|
194 |
+
</div>
|
195 |
+
</div>
|
196 |
+
<?php
|
197 |
}
|
198 |
|
199 |
|
408 |
|
409 |
|
410 |
// get item
|
411 |
+
var item = json[0],
|
412 |
+
div = self.parent.acf_div;
|
413 |
|
414 |
|
415 |
// update acf_div
|
416 |
+
div.find('input.value').val( item.id );
|
417 |
+
div.find('img').attr( 'src', item.url );
|
418 |
+
div.addClass('active');
|
419 |
|
420 |
|
421 |
// validation
|
422 |
+
div.closest('.field').removeClass('error');
|
423 |
|
424 |
|
425 |
// reset acf_div and return false
|
488 |
self.parent.acf_div.closest('.repeater').find('.add-row-end').trigger('click');
|
489 |
|
490 |
// set acf_div to new row image
|
491 |
+
self.parent.acf_div = self.parent.acf_div.closest('.repeater').find('> table > tbody > tr:last-child .acf-image-uploader');
|
492 |
}
|
493 |
else
|
494 |
{
|
css/input.css
CHANGED
@@ -175,87 +175,144 @@
|
|
175 |
|
176 |
|
177 |
/*---------------------------------------------------------------------------------------------
|
178 |
-
|
179 |
-
|
180 |
-
|
|
|
|
|
|
|
|
|
181 |
position: relative;
|
182 |
}
|
183 |
|
184 |
-
.
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
}
|
197 |
|
198 |
-
.
|
199 |
display: block;
|
|
|
200 |
}
|
201 |
|
202 |
-
.
|
203 |
-
|
204 |
}
|
205 |
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
}
|
211 |
|
212 |
-
.
|
213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
}
|
215 |
|
216 |
-
.
|
217 |
display: block;
|
218 |
-
margin: 0
|
|
|
219 |
}
|
220 |
|
221 |
-
.
|
222 |
-
|
223 |
}
|
224 |
|
225 |
-
.
|
226 |
-
|
|
|
|
|
|
|
|
|
|
|
227 |
}
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
/*---------------------------------------------------------------------------------------------
|
230 |
File Upload
|
231 |
---------------------------------------------------------------------------------------------*/
|
232 |
-
.
|
233 |
position: relative;
|
234 |
line-height: 1.5em;
|
235 |
}
|
236 |
|
237 |
-
.
|
238 |
display: none;
|
239 |
}
|
240 |
|
241 |
-
.
|
242 |
display: block;
|
243 |
}
|
244 |
|
245 |
-
.
|
246 |
display: block;
|
247 |
}
|
248 |
|
249 |
-
.
|
250 |
display: none;
|
251 |
}
|
252 |
|
253 |
-
.
|
254 |
margin: 0 5px 0 0;
|
255 |
height:
|
256 |
}
|
257 |
|
258 |
-
.
|
259 |
width: auto;
|
260 |
}
|
261 |
|
175 |
|
176 |
|
177 |
/*---------------------------------------------------------------------------------------------
|
178 |
+
*
|
179 |
+
* Image Upload
|
180 |
+
*
|
181 |
+
*---------------------------------------------------------------------------------------------*/
|
182 |
+
|
183 |
+
|
184 |
+
.acf-image-uploader {
|
185 |
position: relative;
|
186 |
}
|
187 |
|
188 |
+
.acf-image-uploader .has-image { display: none; float: left; position: relative; }
|
189 |
+
.acf-image-uploader .no-image { display: block; float: left; position: relative; }
|
190 |
+
|
191 |
+
.acf-image-uploader.active .has-image { display: block; }
|
192 |
+
.acf-image-uploader.active .no-image { display: none; }
|
193 |
+
|
194 |
+
|
195 |
+
.acf-image-uploader img {
|
196 |
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
197 |
+
max-width:100%;
|
198 |
+
height: auto;
|
199 |
+
display: block;
|
200 |
}
|
201 |
|
202 |
+
.acf-image-uploader .no-image p {
|
203 |
display: block;
|
204 |
+
margin: 0 !important;
|
205 |
}
|
206 |
|
207 |
+
.acf-image-uploader input.button {
|
208 |
+
width: auto;
|
209 |
}
|
210 |
|
211 |
+
|
212 |
+
/*
|
213 |
+
* Hover
|
214 |
+
*/
|
215 |
+
|
216 |
+
.acf-image-uploader .hover {
|
217 |
+
position: absolute;
|
218 |
+
top: -11px;
|
219 |
+
right: -11px;
|
220 |
+
|
221 |
+
-webkit-transition: opacity 0.25s 0s ease-in-out, visibility 0s linear 0.25s;
|
222 |
+
-moz-transition: opacity 0.25s 0s ease-in-out, visibility 0s linear 0.25s;
|
223 |
+
-o-transition: opacity 0.25s 0s ease-in-out, visibility 0s linear 0.25s;
|
224 |
+
transition: opacity 0.25s 0s ease-in-out, visibility 0s linear 0.25s;
|
225 |
+
|
226 |
+
visibility: hidden;
|
227 |
+
opacity: 0;
|
228 |
}
|
229 |
|
230 |
+
.acf-image-uploader .has-image:hover .hover {
|
231 |
+
-webkit-transition-delay:0s;
|
232 |
+
-moz-transition-delay:0s;
|
233 |
+
-o-transition-delay:0s;
|
234 |
+
transition-delay:0s;
|
235 |
+
|
236 |
+
visibility: visible;
|
237 |
+
opacity: 1;
|
238 |
}
|
239 |
|
240 |
+
.acf-image-uploader .hover ul {
|
241 |
display: block;
|
242 |
+
margin: 0;
|
243 |
+
padding: 0;
|
244 |
}
|
245 |
|
246 |
+
.acf-image-uploader .hover ul li {
|
247 |
+
margin: 0 0 5px 0;
|
248 |
}
|
249 |
|
250 |
+
.acf-image-uploader .hover a {
|
251 |
+
background: url("../images/sprite.png") no-repeat scroll -54px -102px #fff;
|
252 |
+
display: block;
|
253 |
+
height: 22px;
|
254 |
+
width: 22px;
|
255 |
+
border-radius: 15px;
|
256 |
+
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
|
257 |
}
|
258 |
|
259 |
+
.acf-image-uploader .hover a:hover {
|
260 |
+
background-position: -54px -152px;
|
261 |
+
}
|
262 |
+
|
263 |
+
.acf-image-uploader .hover a.edit-image {
|
264 |
+
background-position: -45px -345px;
|
265 |
+
}
|
266 |
+
.acf-image-uploader .hover a.edit-image:hover {
|
267 |
+
background-position: -45px -395px;
|
268 |
+
}
|
269 |
+
|
270 |
+
|
271 |
+
/*---------------------------------------------------------------------------------------------
|
272 |
+
*
|
273 |
+
* ACF Message Wrapper (used by image / file / gallery)
|
274 |
+
*
|
275 |
+
*---------------------------------------------------------------------------------------------*/
|
276 |
+
|
277 |
+
.acf-message-wrapper {
|
278 |
+
margin: 10px 0;
|
279 |
+
}
|
280 |
+
|
281 |
+
.acf-message-wrapper .message {
|
282 |
+
margin: 0 !important;
|
283 |
+
}
|
284 |
+
|
285 |
+
|
286 |
/*---------------------------------------------------------------------------------------------
|
287 |
File Upload
|
288 |
---------------------------------------------------------------------------------------------*/
|
289 |
+
.acf-file-uploader {
|
290 |
position: relative;
|
291 |
line-height: 1.5em;
|
292 |
}
|
293 |
|
294 |
+
.acf-file-uploader .has-file {
|
295 |
display: none;
|
296 |
}
|
297 |
|
298 |
+
.acf-file-uploader .no-file {
|
299 |
display: block;
|
300 |
}
|
301 |
|
302 |
+
.acf-file-uploader.active .has-file {
|
303 |
display: block;
|
304 |
}
|
305 |
|
306 |
+
.acf-file-uploader.active .no-file {
|
307 |
display: none;
|
308 |
}
|
309 |
|
310 |
+
.acf-file-uploader img {
|
311 |
margin: 0 5px 0 0;
|
312 |
height:
|
313 |
}
|
314 |
|
315 |
+
.acf-file-uploader input.button {
|
316 |
width: auto;
|
317 |
}
|
318 |
|
js/input-actions.js
CHANGED
@@ -286,10 +286,11 @@ var acf = {
|
|
286 |
* @created: 1/03/2011
|
287 |
*/
|
288 |
|
289 |
-
|
|
|
290 |
|
291 |
// vars
|
292 |
-
var div = $(this).closest('.
|
293 |
|
294 |
// set global var
|
295 |
window.acf_div = div;
|
@@ -299,11 +300,12 @@ var acf = {
|
|
299 |
|
300 |
return false;
|
301 |
});
|
302 |
-
|
303 |
-
|
|
|
304 |
|
305 |
// vars
|
306 |
-
var div = $(this).closest('.
|
307 |
|
308 |
div.removeClass('active').find('input.value').val('');
|
309 |
|
@@ -311,6 +313,26 @@ var acf = {
|
|
311 |
|
312 |
});
|
313 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
|
315 |
/*
|
316 |
* Field: Image
|
@@ -319,11 +341,12 @@ var acf = {
|
|
319 |
* @created: 1/03/2011
|
320 |
*/
|
321 |
|
322 |
-
|
|
|
323 |
|
324 |
// vars
|
325 |
-
var div = $(this).closest('.
|
326 |
-
|
327 |
|
328 |
// set global var
|
329 |
window.acf_div = div;
|
@@ -333,16 +356,39 @@ var acf = {
|
|
333 |
|
334 |
return false;
|
335 |
});
|
336 |
-
|
337 |
-
|
|
|
338 |
|
339 |
// vars
|
340 |
-
var div = $(this).closest('.
|
341 |
|
342 |
-
div.removeClass('active')
|
|
|
|
|
343 |
|
344 |
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
});
|
347 |
|
348 |
|
@@ -1045,7 +1091,7 @@ var acf = {
|
|
1045 |
|
1046 |
var message = $('<div class="acf-message-wrapper"><div class="message updated"><p>' + message + '</p></div></div>');
|
1047 |
|
1048 |
-
div.
|
1049 |
|
1050 |
setTimeout(function(){
|
1051 |
|
@@ -1055,7 +1101,7 @@ var acf = {
|
|
1055 |
message.remove();
|
1056 |
});
|
1057 |
|
1058 |
-
},
|
1059 |
|
1060 |
};
|
1061 |
|
286 |
* @created: 1/03/2011
|
287 |
*/
|
288 |
|
289 |
+
// add file
|
290 |
+
$('.acf-file-uploader .add-file').live('click', function(){
|
291 |
|
292 |
// vars
|
293 |
+
var div = $(this).closest('.acf-file-uploader');
|
294 |
|
295 |
// set global var
|
296 |
window.acf_div = div;
|
300 |
|
301 |
return false;
|
302 |
});
|
303 |
+
|
304 |
+
// remove file
|
305 |
+
$('.acf-file-uploader .remove-file').live('click', function(){
|
306 |
|
307 |
// vars
|
308 |
+
var div = $(this).closest('.acf-file-uploader');
|
309 |
|
310 |
div.removeClass('active').find('input.value').val('');
|
311 |
|
313 |
|
314 |
});
|
315 |
|
316 |
+
// edit file
|
317 |
+
$('.acf-file-uploader .edit-file').live('click', function(){
|
318 |
+
|
319 |
+
// vars
|
320 |
+
var div = $(this).closest('.acf-file-uploader'),
|
321 |
+
id = div.find('input.value').val();
|
322 |
+
|
323 |
+
|
324 |
+
// set global var
|
325 |
+
window.acf_edit_attachment = div;
|
326 |
+
|
327 |
+
|
328 |
+
// show edit attachment
|
329 |
+
tb_show('Edit File', acf.admin_url + 'media.php?attachment_id=' + id + '&action=edit&acf_action=edit_attachment&acf_field=file&TB_iframe=1');
|
330 |
+
|
331 |
+
|
332 |
+
return false;
|
333 |
+
|
334 |
+
});
|
335 |
+
|
336 |
|
337 |
/*
|
338 |
* Field: Image
|
341 |
* @created: 1/03/2011
|
342 |
*/
|
343 |
|
344 |
+
// add image
|
345 |
+
$('.acf-image-uploader .add-image').live('click', function(){
|
346 |
|
347 |
// vars
|
348 |
+
var div = $(this).closest('.acf-image-uploader'),
|
349 |
+
preview_size = div.attr('data-preview_size');
|
350 |
|
351 |
// set global var
|
352 |
window.acf_div = div;
|
356 |
|
357 |
return false;
|
358 |
});
|
359 |
+
|
360 |
+
// remove image
|
361 |
+
$('.acf-image-uploader .remove-image').live('click', function(){
|
362 |
|
363 |
// vars
|
364 |
+
var div = $(this).closest('.acf-image-uploader');
|
365 |
|
366 |
+
div.removeClass('active');
|
367 |
+
div.find('input.value').val('');
|
368 |
+
div.find('img').attr('src', '');
|
369 |
|
370 |
return false;
|
371 |
+
|
372 |
+
});
|
373 |
+
|
374 |
+
// edit image
|
375 |
+
$('.acf-image-uploader .edit-image').live('click', function(){
|
376 |
+
|
377 |
+
// vars
|
378 |
+
var div = $(this).closest('.acf-image-uploader'),
|
379 |
+
id = div.find('input.value').val();
|
380 |
|
381 |
+
|
382 |
+
// set global var
|
383 |
+
window.acf_edit_attachment = div;
|
384 |
+
|
385 |
+
|
386 |
+
// show edit attachment
|
387 |
+
tb_show('Edit Image', acf.admin_url + 'media.php?attachment_id=' + id + '&action=edit&acf_action=edit_attachment&acf_field=image&TB_iframe=1');
|
388 |
+
|
389 |
+
|
390 |
+
return false;
|
391 |
+
|
392 |
});
|
393 |
|
394 |
|
1091 |
|
1092 |
var message = $('<div class="acf-message-wrapper"><div class="message updated"><p>' + message + '</p></div></div>');
|
1093 |
|
1094 |
+
div.prepend( message );
|
1095 |
|
1096 |
setTimeout(function(){
|
1097 |
|
1101 |
message.remove();
|
1102 |
});
|
1103 |
|
1104 |
+
}, 1500);
|
1105 |
|
1106 |
};
|
1107 |
|
readme.txt
CHANGED
@@ -85,6 +85,11 @@ http://www.advancedcustomfields.com/support/
|
|
85 |
|
86 |
== Changelog ==
|
87 |
|
|
|
|
|
|
|
|
|
|
|
88 |
= 3.2.6 =
|
89 |
* [Fixed] Fix flexible content inside repeater add extra row jquery bug - http://www.advancedcustomfields.com/support/discussion/2134/add-flexible-content-button-in-repeater-field-adds-new-repeater-row
|
90 |
* [Added] Add suppress_filters to relationship field for WPML compatibility - http://www.advancedcustomfields.com/support/discussion/comment/5401#Comment_5401
|
85 |
|
86 |
== Changelog ==
|
87 |
|
88 |
+
= 3.2.7 =
|
89 |
+
* [Fixed] Rename controller classes - http://www.advancedcustomfields.com/support/discussion/2363/fatal-error-after-update-to-3.2.6
|
90 |
+
* [Added] Add edit button to image / file fields
|
91 |
+
* [Fixed] WYSIWYG toolbar buttons dissapearing in HTML tab mode
|
92 |
+
|
93 |
= 3.2.6 =
|
94 |
* [Fixed] Fix flexible content inside repeater add extra row jquery bug - http://www.advancedcustomfields.com/support/discussion/2134/add-flexible-content-button-in-repeater-field-adds-new-repeater-row
|
95 |
* [Added] Add suppress_filters to relationship field for WPML compatibility - http://www.advancedcustomfields.com/support/discussion/comment/5401#Comment_5401
|