being not that much of a js guy using http://fineuploader.com/demos.html gave me a good headstart getting fineuploader working in the citadel webinterface. My last issue which I fail to achieve is getting a deleteComplete hook registered (as documented here: http://docs.fineuploader.com/api/events.html#deleteComplete ) I'm probably missing some domain specific vocabulary, so my general question is, how does one specify event handlers, the deleteComplete one in specific.
My need is to call update_attachment_count() which should refresh the number of attachments uploaded for the mail being composed in the main screen.
so far I've got (we don't use jquery):
<script type="text/javascript">
function createUploader()
{
var uploader = new qq.FineUploader(
{
session: {
endpoint: "do_template?template=edit_message_json_attlist"
},
callbacks: {
onComplete: update_attachment_count,
delete: update_attachment_count,
deleteComplete: update_attachment_count
},
element: document.getElementById('fine-uploader'),
request: {
endpoint: 'upload_attachment?nonce=<?NONCE>&template=edit_message_upl_att'
},
deleteFile: {
enabled: true,
forceConfirm: true,
endpoint: 'remove_attachment?nonce=<?NONCE>&template=edit_message_upl_att&which_attachment='
}
});
}
window.onload = createUploader;
</script>
<div id="fine-uploader"></div>
...
<script type="text/javascript">
function update_attachment_count() {
p = 'r=' + CtdlRandomString();
new Ajax.Updater(
'num_attachments',
'show_num_attachments',
{
method: 'get',
parameters: p
}
);
}
</script>
</div>
TIA, and thanks a lot for making Fineuploader available.