+// Method about queues
+
+DDFileUploaderBase.prototype.previewQueuePush = function(slide) {
+ this.previewQueue.push(slide);
+ if (!this._previewQueueRunning) {
+ this.startPreviewQueue();
+ }
+};
+
+DDFileUploaderBase.prototype.startPreviewQueue = function() {
+ this._previewQueueRunning = true;
+ this.previewQueueLoadNext();
+};
+
+DDFileUploaderBase.prototype.previewQueueLoadNext = function() {
+ if (this.previewQueue.length && this.previewsLoaded < MAX_PREVIEW) {
+ var slide = this.previewQueue.shift();
+ this.previewUploadedImage(slide);
+ this.previewsLoaded++;
+ }
+ else {
+ this._previewQueueRunning = false;
+ }
+};
+
+DDFileUploaderBase.prototype.uploadQueuePush = function(slide) {
+ this.uploadQueue.push(slide);
+ if (!this._uploadQueueRunning) {
+ this.startUploadQueue();
+ }
+};
+
+DDFileUploaderBase.prototype.startUploadQueue = function() {
+ this._uploadQueueRunning = true;
+ this.uploadQueueLoadNext();
+};
+
+
+DDFileUploaderBase.prototype.uploadQueueLoadNext = function() {
+ var slide = this.uploadQueue.shift();
+ if (slide) {
+ this.upload(slide);
+ }
+ else {
+ this._uploadQueueRunning = false;
+ }
+};
+
+