switch media uploader to prototype
This commit is contained in:
parent
5d66b8b589
commit
e8c2bdabe5
@ -208,7 +208,7 @@ class ComicPressAddonCore extends ComicPressAddon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($pagenow, "media-upload") === 0) {
|
if (strpos($pagenow, "media-upload") === 0) {
|
||||||
wp_enqueue_script('cp-media', get_stylesheet_directory_uri() . '/js/MediaUpload.js', array('jquery'));
|
wp_enqueue_script('cp-media', get_stylesheet_directory_uri() . '/js/MediaUpload.js', array('prototype'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,18 +1,22 @@
|
|||||||
jQuery(function() {
|
Event.observe(window, 'load', function() {
|
||||||
jQuery('.media-item').each(function() {
|
$$('.media-item').each(function(item) {
|
||||||
var item = this;
|
item.select('.savesend').each(function(savesend) {
|
||||||
jQuery('.savesend', item).each(function() {
|
var button = new Element('input', { type: 'submit', name: 'save', value: 'Save changes' }).addClassName('button');
|
||||||
jQuery(this).prepend(jQuery('<input type="submit" name="save" value="Save changes" />').addClass('button'));
|
savesend.insert({top: button});
|
||||||
});
|
});
|
||||||
|
|
||||||
var show_insert = function(t) {
|
var show_insert = function(t) {
|
||||||
jQuery('input[name*=send]', item)[(t.value == 'none') ? 'show' : 'hide']();
|
var b = item.select('input[name*=send]').pop();
|
||||||
};
|
if (b) { b[(t.value == 'none') ? 'show' : 'hide'](); }
|
||||||
|
}
|
||||||
|
|
||||||
jQuery('input[name*=comic_image_type]', item).bind('click', function() { show_insert(this); });
|
item.select('input[name*=comic_image_type]').each(function(radio) {
|
||||||
var type = jQuery('input[name*=comic_image_type][checked]', item).get(0);
|
radio.observe('click', function(e) { show_insert(radio); });
|
||||||
|
});
|
||||||
|
|
||||||
|
var type = item.select('input[name*=comic_image_type][checked]').pop();
|
||||||
if (type) {
|
if (type) {
|
||||||
jQuery('.filename.new', item).append(jQuery('<strong />').text(' (' + jQuery.trim(jQuery(type).parent().text()) + ')'));
|
item.select('.filename.new').pop().insert({bottom: new Element('strong').update(type.parentNode.innerHTML.stripTags())});
|
||||||
show_insert(type);
|
show_insert(type);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user