comicpress-core/js/MediaUpload.js

23 lines
839 B
JavaScript
Raw Normal View History

2009-11-03 03:32:31 +00:00
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});
2009-11-02 03:32:35 +00:00
});
2009-11-03 03:32:31 +00:00
2009-11-02 03:32:35 +00:00
var show_insert = function(t) {
2009-11-03 03:32:31 +00:00
var b = item.select('input[name*=send]').pop();
2009-11-19 02:25:35 +00:00
if (b) { b[(t.checked) ? 'hide' : 'show'](); }
2009-11-03 03:32:31 +00:00
}
2009-11-17 02:53:40 +00:00
var type = item.select('input[name*=comicpress_management][checked]').pop();
2009-11-02 03:32:35 +00:00
if (type) {
2009-11-17 02:53:40 +00:00
item.select('.filename.new').pop().insert({bottom: new Element('div').addClassName('comicpress-is-managing')});
2009-11-02 03:32:35 +00:00
show_insert(type);
}
2009-11-19 02:25:35 +00:00
item.select('input[name*=comicpress_management]').invoke('observe', 'change', function(e) { show_insert(e.target); });
2009-11-02 03:32:35 +00:00
});
2009-11-03 03:32:31 +00:00
});