big improvements to media uploader
This commit is contained in:
parent
ed8231a193
commit
831b8d80c6
@ -263,6 +263,7 @@ class ComicPressAddonCore extends ComicPressAddon {
|
||||
global $pagenow;
|
||||
|
||||
$current_type = get_post_meta($post->ID, 'comic_image_type', true);
|
||||
if (empty($current_type)) { $current_type = reset(array_keys($this->comic_image_types)); }
|
||||
|
||||
$field_html_lines = array();
|
||||
$field_html_lines[] = '<input type="hidden" name="cp[_nonce]" value="' . wp_create_nonce('comicpress') . '" />';
|
||||
|
19
js/MediaUpload.js
Normal file
19
js/MediaUpload.js
Normal file
@ -0,0 +1,19 @@
|
||||
jQuery(function() {
|
||||
jQuery('.media-item').each(function() {
|
||||
var item = this;
|
||||
jQuery('.savesend', item).each(function() {
|
||||
jQuery(this).prepend(jQuery('<input type="submit" name="save" value="Save changes" />').addClass('button'));
|
||||
});
|
||||
|
||||
var show_insert = function(t) {
|
||||
jQuery('input[name*=send]', item)[(t.value == 'none') ? 'show' : 'hide']();
|
||||
};
|
||||
|
||||
jQuery('input[name*=comic_image_type]', item).bind('click', function() { show_insert(this); });
|
||||
var type = jQuery('input[name*=comic_image_type][checked]', item).get(0);
|
||||
if (type) {
|
||||
jQuery('.filename.new', item).append(jQuery('<strong />').text(' (' + jQuery.trim(jQuery(type).parent().text()) + ')'));
|
||||
show_insert(type);
|
||||
}
|
||||
});
|
||||
});
|
@ -1,12 +0,0 @@
|
||||
jQuery(function() {
|
||||
jQuery('.media-item').each(function() {
|
||||
var item = this;
|
||||
jQuery('.savesend', item).each(function() {
|
||||
|
||||
});
|
||||
jQuery('input[name*=comic_image_type]', item).bind('change', function() {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user