-
+ CB2D7496EEC5266C55565537E016793825EF736BFE7AAF87BA26F997C95FBBADF4E2E5CBA7649DE9F20F482839CF8518A6F82529B2FC9C89FC454FAD01D0340C
mp-wp/wp-includes/js/swfupload/plugins/swfupload.queue.js
(0 . 0)(1 . 77)
116632 /*
116633 Queue Plug-in
116634
116635 Features:
116636 *Adds a cancelQueue() method for cancelling the entire queue.
116637 *All queued files are uploaded when startUpload() is called.
116638 *If false is returned from uploadComplete then the queue upload is stopped.
116639 If false is not returned (strict comparison) then the queue upload is continued.
116640 *Adds a QueueComplete event that is fired when all the queued files have finished uploading.
116641 Set the event handler with the queue_complete_handler setting.
116642
116643 */
116644
116645 var SWFUpload;
116646 if (typeof(SWFUpload) === "function") {
116647 SWFUpload.queue = {};
116648
116649 SWFUpload.prototype.initSettings = (function (oldInitSettings) {
116650 return function () {
116651 if (typeof(oldInitSettings) === "function") {
116652 oldInitSettings.call(this);
116653 }
116654
116655 this.customSettings.queue_cancelled_flag = false;
116656 this.customSettings.queue_upload_count = 0;
116657
116658 this.settings.user_upload_complete_handler = this.settings.upload_complete_handler;
116659 this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler;
116660
116661 this.settings.queue_complete_handler = this.settings.queue_complete_handler || null;
116662 };
116663 })(SWFUpload.prototype.initSettings);
116664
116665 SWFUpload.prototype.startUpload = function (fileID) {
116666 this.customSettings.queue_cancelled_flag = false;
116667 this.callFlash("StartUpload", false, [fileID]);
116668 };
116669
116670 SWFUpload.prototype.cancelQueue = function () {
116671 this.customSettings.queue_cancelled_flag = true;
116672 this.stopUpload();
116673
116674 var stats = this.getStats();
116675 while (stats.files_queued > 0) {
116676 this.cancelUpload();
116677 stats = this.getStats();
116678 }
116679 };
116680
116681 SWFUpload.queue.uploadCompleteHandler = function (file) {
116682 var user_upload_complete_handler = this.settings.user_upload_complete_handler;
116683 var continueUpload;
116684
116685 if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {
116686 this.customSettings.queue_upload_count++;
116687 }
116688
116689 if (typeof(user_upload_complete_handler) === "function") {
116690 continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true;
116691 } else {
116692 continueUpload = true;
116693 }
116694
116695 if (continueUpload) {
116696 var stats = this.getStats();
116697 if (stats.files_queued > 0 && this.customSettings.queue_cancelled_flag === false) {
116698 this.startUpload();
116699 } else if (this.customSettings.queue_cancelled_flag === false) {
116700 this.queueEvent("queue_complete_handler", [this.customSettings.queue_upload_count]);
116701 this.customSettings.queue_upload_count = 0;
116702 } else {
116703 this.customSettings.queue_cancelled_flag = false;
116704 this.customSettings.queue_upload_count = 0;
116705 }
116706 }
116707 };
116708 }