src/imageloader.js
function(options) {
        var _this = this,
            complete = function(job) {
                completeJob(_this, job, options.callback);
            },
            jobOptions = {
                src: options.src,
                loadWithAjax: options.loadWithAjax,
                ajaxHeaders: options.loadWithAjax ? options.ajaxHeaders : null,
                crossOriginPolicy: options.crossOriginPolicy,
                ajaxWithCredentials: options.ajaxWithCredentials,
                callback: complete,
                abort: options.abort,
                timeout: this.timeout
            },
            newJob = new ImageJob(jobOptions);

        if ( !this.jobLimit || this.jobsInProgress < this.jobLimit ) {
            newJob.start();
            this.jobsInProgress++;
        }
        else {
            this.jobQueue.push( newJob );
        }
    }
function(options) {
        var _this = this,
            complete = function(job) {
                completeJob(_this, job, options.callback);
            },
            jobOptions = {
                src: options.src,
                loadWithAjax: options.loadWithAjax,
                ajaxHeaders: options.loadWithAjax ? options.ajaxHeaders : null,
                crossOriginPolicy: options.crossOriginPolicy,
                ajaxWithCredentials: options.ajaxWithCredentials,
                callback: complete,
                abort: options.abort,
                timeout: this.timeout
            },
            newJob = new ImageJob(jobOptions);

        if ( !this.jobLimit || this.jobsInProgress < this.jobLimit ) {
            newJob.start();
            this.jobsInProgress++;
        }
        else {
            this.jobQueue.push( newJob );
        }
    }
function ( options ) { var _this = this , complete = function ( job ) { completeJob ( _this , job , options . callback ) ; } , jobOptions = { src : options . src , loadWithAjax : options . loadWithAjax , ajaxHeaders : options . loadWithAjax ? options . ajaxHeaders : null , crossOriginPolicy : options . crossOriginPolicy , ajaxWithCredentials : options . ajaxWithCredentials , callback : complete , abort : options . abort , timeout : this . timeout } , newJob = new ImageJob ( jobOptions ) ; if ( ! this . jobLimit || this . jobsInProgress < this . jobLimit ) { newJob . start ( ) ; this . jobsInProgress ++ ; } else { this . jobQueue . push ( newJob ) ; } }
Add an unloaded image to the loader queue.
@method
@param {Object} options - Options for this job.
@param {String} [options.src] - URL of image to download.
@param {String} [options.loadWithAjax] - Whether to load this image with AJAX.
@param {String} [options.ajaxHeaders] - Headers to add to the image request if using AJAX.
@param {String|Boolean} [options.crossOriginPolicy] - CORS policy to use for downloads
@param {Boolean} [options.ajaxWithCredentials] - Whether to set withCredentials on AJAX
requests.
@param {Function} [options.callback] - Called once image has been downloaded.
@param {Function} [options.abort] - Called when this image job is aborted.
Add an unloaded image to the loader queue .