5 cancelQueue method for cancelling the entire queue.
6 All queued files are uploaded when startUpload() is called.
7 If false is returned from uploadComplete then the queue upload is stopped. If false is not returned (strict comparison) then the queue upload is continued.
12 if (typeof(SWFUpload) === "function") {
15 SWFUpload.prototype.initSettings = function (old_initSettings) {
16 return function (init_settings) {
17 if (typeof(old_initSettings) === "function") {
18 old_initSettings.call(this, init_settings);
21 this.customSettings.queue_cancelled_flag = false;
23 this.addSetting("user_upload_complete_handler", init_settings.upload_complete_handler, SWFUpload.uploadComplete);
24 this.uploadComplete_handler = SWFUpload.queue.uploadComplete;
26 }(SWFUpload.prototype.initSettings);
28 SWFUpload.prototype.cancelQueue = function () {
29 var stats = this.getStats();
30 this.customSettings.queue_cancelled_flag = false;
32 if (stats.in_progress > 0) {
33 this.customSettings.queue_cancelled_flag = true;
36 while(stats.files_queued > 0) {
38 stats = this.getStats();
42 SWFUpload.queue.uploadComplete = function (file) {
43 var user_upload_complete_handler = this.getSetting("user_upload_complete_handler");
44 var continue_upload = true;
45 if (typeof(user_upload_complete_handler) === "function") {
46 continue_upload = (user_upload_complete_handler.call(this, file) === false) ? false : true;
49 if (continue_upload) {
50 var stats = this.getStats();
51 if (stats.files_queued > 0 && this.customSettings.queue_cancelled_flag === false) {
54 this.customSettings.queue_cancelled_flag = false;