var hash = window.location.hash.substring(1);
if (hash === 'add-note'){
$('#add-note-form').show();
- $('div.upload-status').hide();
$('#add-note-btn').hide();
}
}
$('#add-note-btn').click(function(){
- // hide the button added by qq
- $('#file-uploader').hide();
// show the add note form
// TODO: rewrite to .show the form with a slide transition
$('#add-note-form').show();
onSubmit: function (id, fileName) {
$('#file-uploader').hide();
$('div.upload-status').show();
+ // hide the button added by qq
+ $('#file-uploader').hide();
+ // show the progress bar
+ $('div.upload-status').show();
+ console.log('fileName:', fileName);
+ },
+ onError: function (id, fileName, errorReason) {
+ console.log('FileUploader error:', errorReason);
+ },
+ onCancel: function (id, fileName) {
+ console.log('FileUploader cancel:', onCancel);
},
-
onComplete: function( id, fileName, responseJSON ) {
if( responseJSON.success ) {
console.log("responseJSON.note_url " + responseJSON.note_url);
<form id=add-note method="POST">
{% csrf_token %}
<div class="row">
- <div class="four columns offset-by-one upload-status">
+ <div class="four columns offset-by-one upload-status" style="display:none">
<legend><span id=add-note-status>Uploading</span> <span id=filename>note</span>...</legend>
<div class=progress> <div id="progress-fill"></div> </div>
</div>