comicpress-core/js/MediaUpload.js
2009-11-16 21:53:40 -05:00

20 lines
722 B
JavaScript

Event.observe(window, 'load', function() {
$$('.media-item').each(function(item) {
item.select('.savesend').each(function(savesend) {
var button = new Element('input', { type: 'submit', name: 'save', value: 'Save changes' }).addClassName('button');
savesend.insert({top: button});
});
var show_insert = function(t) {
var b = item.select('input[name*=send]').pop();
if (b) { b[(t.value == 'none') ? 'show' : 'hide'](); }
}
var type = item.select('input[name*=comicpress_management][checked]').pop();
if (type) {
item.select('.filename.new').pop().insert({bottom: new Element('div').addClassName('comicpress-is-managing')});
show_insert(type);
}
});
});