$(document).ready(function() {
    var errorHandler = function(event, id, fileName, reason, xhr) {
        qq.log("id: " + id + ", fileName: " + fileName + ", reason: " + reason);
    };

    var fileNum = 0;

    $('#basicUploadSuccessExample').fineUploader({
        debug: true,
//        cors: {
//            expected: true
//        },
        request: {
            endpoint: "/upload/receiver",
            paramsInBody: true
//            params: {
//                test: 'one',
//                blah: 'foo',
//                bar: {
//                    one: '1',
//                    two: '2',
//                    three: {
//                        foo: 'bar'
//                    }
//                },
//                fileNum: function() {
//                    fileNum+=1;
//                    return fileNum;
//                }
//            }
        },
        chunking: {
            enabled: true
        },
        resume: {
            enabled: true
        },
        retry: {
            enableAuto: true,
            showButton: true
        },
        deleteFile: {
            enabled: true,
            endpoint: '/upload/receiver',
            forceConfirm: true,
            params: {foo: "bar"}
        },
        display: {
            fileSizeOnSubmit: true
        },
        paste: {
            targetElement: $(document)
        }
    })
        .on('error', errorHandler)
        .on('uploadChunk resume', function(event, id, fileName, chunkData) {
            qq.log('on' + event.type + ' -  ID: ' + id + ", FILENAME: " + fileName + ", PARTINDEX: " + chunkData.partIndex + ", STARTBYTE: " + chunkData.startByte + ", ENDBYTE: " + chunkData.endByte + ", PARTCOUNT: " + chunkData.totalParts);
        })
        .on("upload", function(event, id, filename) {
            $(this).fineUploader('setParams', {"hey": "ho"}, id);
        })
        .on("submit", function() {
            var promise =  new qq.Promise();
            setTimeout(function() {
                promise.failure();
            }, 5000);
            return promise;
        })
        .on("statusChange", function(event, id, oldStatus, newStatus) {
            qq.log("id: " + id + ", prev: " + oldStatus + ", new: " + newStatus);
        });
//        on("pasteReceived", function(event, blob) {
//            qq.log(blob);
//            return new qq.Promise().success();
//        });

    $('#manualUploadModeExample').fineUploader({
        autoUpload: false,
        debug: true,
        uploadButtonText: "Select Files",
        request: {
            endpoint: "/upload/receiver"
        },
        display: {
            fileSizeOnSubmit: true
        }
    }).on('error', errorHandler);

    $('#triggerUpload').click(function() {
        $('#manualUploadModeExample').fineUploader("uploadStoredFiles");
    });


    $('#basicUploadFailureExample').fineUploader({
        request: {
            endpoint: "/upload/receiver",
            params: {"generateError": "true"}
        },
        debug: true,
        failedUploadTextDisplay: {
            mode: 'custom',
            maxChars: 5
        },
        retry: {
            enableAuto: true,
            showButton: true
        }
    }).on('error', errorHandler);


    $('#uploadWithVariousOptionsExample').fineUploader({
        multiple: false,
        request: {
            endpoint: "/upload/receiver"
        },
        debug: true,
        validation: {
            allowedExtensions: ['jpeg', 'jpg', 'txt'],
            sizeLimit: 50000,
            minSizeLimit: 2000
        },
        text: {
            uploadButton: "Click Or Drop"
        },
        display: {
            fileSizeOnSubmit: true
        }
    }).on('error', errorHandler);


    $('#fubExample').fineUploader({
        uploaderType: 'basic',
        multiple: false,
        debug: true,
        autoUpload: false,
        button: $("#fubUploadButton"),
        request: {
            endpoint: "/upload/receiver"
        }
    }).on('error', errorHandler);
});

@@ -1901,32 +1901,34 @@
 %22, function() %7B%0A
+//
             var 
@@ -1952,24 +1952,26 @@
 .Promise();%0A
+//
             
@@ -1986,32 +1986,34 @@
 ut(function() %7B%0A
+//
                 
@@ -2031,16 +2031,18 @@
 lure();%0A
+//
         
@@ -2055,16 +2055,18 @@
  5000);%0A
+//
         

comment out temp testing code