| | 111 | }, |
| | 112 | onError: function (event, queueID ,fileObj, errorObj) { |
| | 113 | var msg; |
| | 114 | if (errorObj.status == 404) { |
| | 115 | alert('Could not find upload script.'); |
| | 116 | msg = 'Could not find upload script.'; |
| | 117 | } |
| | 118 | else if (errorObj.type === "HTTP") { |
| | 119 | msg = errorObj.type+": "+errorObj.status; |
| | 120 | } |
| | 121 | else if (errorObj.type ==="File Size") { |
| | 122 | msg = fileObj.name+'<br>'+errorObj.type+' Limit: '+Math.round(errorObj.sizeLimit/1024)+'KB'; |
| | 123 | } |
| | 124 | else { |
| | 125 | msg = errorObj.type+": "+errorObj.text; |
| | 126 | } |
| | 127 | |
| | 128 | $.jGrowl( |
| | 129 | '<p></p>'+msg, |
| | 130 | { |
| | 131 | theme: 'error', |
| | 132 | header: 'ERROR', |
| | 133 | sticky: true |
| | 134 | } |
| | 135 | ); |
| | 136 | |
| | 137 | $("#fileUploadgrowl" + queueID).fadeOut( |
| | 138 | 250, |
| | 139 | function() { |
| | 140 | $("#fileUploadgrowl" + queueID).remove() |
| | 141 | } |
| | 142 | ); |
| | 143 | return false; |
| | 144 | }, |
| | 145 | onCancel: function (a, b, c, d) { |
| | 146 | var msg = "Cancelled uploading: "+c.name; |
| | 147 | $.jGrowl( |
| | 148 | '<p></p>'+msg, |
| | 149 | { |
| | 150 | theme: 'warning', |
| | 151 | header: 'Cancelled Upload', |
| | 152 | life: 4000, |
| | 153 | sticky: false |
| | 154 | } |
| | 155 | ); |
| | 156 | }, |
| | 157 | onClearQueue: function (a, b) { |
| | 158 | var msg = "Cleared "+b.fileCount+" files from queue"; |
| | 159 | $.jGrowl( |
| | 160 | '<p></p>'+msg, |
| | 161 | { |
| | 162 | theme: 'warning', |
| | 163 | header: 'Cleared Queue', |
| | 164 | life: 4000, |
| | 165 | sticky: false |
| | 166 | } |
| | 167 | ); |
| | 168 | }, |
| | 169 | onComplete: function (a, b ,c, d, e) { |
| | 170 | var size = Math.round(c.size/1024); |
| | 171 | $.jGrowl( |
| | 172 | '<p></p>'+c.name+' - '+size+'KB', |
| | 173 | { |
| | 174 | theme: 'success', |
| | 175 | header: 'Upload Complete', |
| | 176 | life: 4000, |
| | 177 | sticky: false |
| | 178 | } |
| | 179 | ); |