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"}
  • 相关阅读:
    《SQL Server 2000设计与T-SQL编程》
    sql语句优化 (转)
    SQL Server优化50法(转)
    (转)SQL 优化原则
    sql 锁
    后台服务标准化运营
    ReactNative For Android 框架启动核心路径剖析
    手机QQ会员H5加速方案——sonic技术内幕
    微信支付商户系统架构背后的故事
    [干货] 有了微信小程序,谁还学ReactNative?
  • 原文地址:https://www.cnblogs.com/chucklu/p/11121669.html
Copyright © 2011-2022 走看看