2009-12-06 22:38:55 +00:00
|
|
|
<div id="comicpress-backend-url-holder-container">
|
|
|
|
<?php
|
|
|
|
foreach ($backends as $backend) {
|
|
|
|
include('_editor.inc');
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<a href="#" id="comicpress-backend-url-add-new">Add a new image</a>
|
|
|
|
<script type="text/javascript">
|
2009-12-09 13:21:15 +00:00
|
|
|
(function() {
|
|
|
|
var set_up_deleters = function() {
|
|
|
|
$$('.comicpress-backend-url-holder').each(function(d) {
|
|
|
|
var deleter = d.select('.comicpress-backend-url-deleter').pop();
|
|
|
|
if (deleter) {
|
|
|
|
deleter.stopObserving();
|
|
|
|
deleter.observe('click', function(e) {
|
|
|
|
Event.stop(e);
|
|
|
|
if (confirm('Delete this image?')) {
|
|
|
|
d.remove();
|
|
|
|
}
|
|
|
|
});
|
2009-12-06 22:38:55 +00:00
|
|
|
}
|
2009-12-09 13:21:15 +00:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
$('comicpress-backend-url-add-new').observe('click', function(e) {
|
|
|
|
Event.stop(e);
|
|
|
|
new Ajax.Updater(
|
|
|
|
'comicpress-backend-url-holder-container',
|
|
|
|
ComicPressAdmin.ajax_uri, {
|
|
|
|
'insertion': 'bottom',
|
|
|
|
'parameters': {
|
|
|
|
'cp[_nonce]': ComicPressAdmin.nonce,
|
|
|
|
'cp[action]': 'backend-url-new-editor',
|
|
|
|
'cp[_action_nonce]': '<?php echo esc_js(wp_create_nonce('comicpress-backend-url-new-editor')) ?>'
|
|
|
|
},
|
|
|
|
onComplete: set_up_deleters
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
set_up_deleters();
|
|
|
|
}());
|
2009-12-06 22:38:55 +00:00
|
|
|
</script>
|