zoukankan      html  css  js  c++  java
  • jQuery file upload process queue

    在jquery.ui.widget.js中bridge处打上断点,查看instance内容

    $.widget.bridge = function( name, object ) {
        var fullName = object.prototype.widgetFullName || name;
        $.fn[ name ] = function( options ) {
            var isMethodCall = typeof options === "string",
                args = widget_slice.call( arguments, 1 ),
                returnValue = this;
    
            if ( isMethodCall ) {
                this.each(function() {
                    var methodValue,
                        instance = $.data( this, fullName );
                    if ( options === "instance" ) {
                        returnValue = instance;
                        return false;
                    }
                    if ( !instance ) {
                        return $.error( "cannot call methods on " + name + " prior to initialization; " +
                            "attempted to call method '" + options + "'" );
                    }
                    if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
                        return $.error( "no such method '" + options + "' for " + name + " widget instance" );
                    }
                    methodValue = instance[ options ].apply( instance, args );
                    if ( methodValue !== instance && methodValue !== undefined ) {
                        returnValue = methodValue && methodValue.jquery ?
                            returnValue.pushStack( methodValue.get() ) :
                            methodValue;
                        return false;
                    }
                });
            } else {
    
                // Allow multiple hashes to be passed on init
                if ( args.length ) {
                    options = $.widget.extend.apply( null, [ options ].concat(args) );
                }
    
                this.each(function() {
                    var instance = $.data( this, fullName );
                    if ( instance ) {
                        instance.option( options || {} );
                        if ( instance._init ) {
                            instance._init();
                        }
                    } else {
                        $.data( this, fullName, new object( options, this ) );
                    }
                });
            }
    
            return returnValue;
        };
    };

    instance.options.processQueue

    1. (8) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
      1. 0: {action: "loadImageMetaData", disableImageHead: "@", disableExif: "@", disableExifThumbnail: "@", disableExifSub: "@", …}
      2. 1: {action: "loadImage", prefix: true, fileTypes: "@", maxFileSize: "@", noRevoke: "@", …}
      3. 2: {action: "resizeImage", prefix: "image", maxWidth: "@", maxHeight: "@", minWidth: "@", …}
      4. 3: {action: "saveImage", quality: "@imageQuality", type: "@imageType", disabled: "@disableImageResize"}
      5. 4: {action: "saveImageMetaData", disabled: "@disableImageMetaDataSave"}
      6. 5: {action: "resizeImage", prefix: "preview", maxWidth: "@", maxHeight: "@", minWidth: "@", …}
      7. 6: {action: "setImage", name: "@imagePreviewName", disabled: "@disableImagePreview"}
      8. 7: {action: "deleteImageReferences", disabled: "@disableImageReferencesDeletion"}
  • 相关阅读:
    Shuffle Cards
    求和VII
    Finite Encyclopedia of Integer Sequences(找规律)
    Codeforces Round #223 (Div. 2) C
    Codeforces Round #223 (Div. 2) A
    题目1047:素数判定
    Codeforces Round #219 (Div. 1) C. Watching Fireworks is Fun
    Codeforces Round #219 (Div. 2) B. Making Sequences is Fun
    中南大学第一届长沙地区程序设计邀请赛 New Sorting Algorithm
    中南大学第一届长沙地区程序设计邀请赛 To Add Which?
  • 原文地址:https://www.cnblogs.com/chucklu/p/11121669.html
Copyright © 2011-2022 走看看