• 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"}
  • 相关阅读:
    在javaWeb 工程中 tomcat 的 web.xml 文件配置
    Spring 框架详解
    构建工具 Maven和Gradle对比
    idea 创建Javaweb 动态工程
    服务器后端 项目代码常用目录图
    ET模式下的EPOLLOUT
    linux recv 参数len设置为0
    fork 和 exec 对子进程继承父进程处理信号处理函数的影响
    lua元表以及元方法
    Linux网络编程“惊群”问题总结
  • 原文地址:https://www.cnblogs.com/chucklu/p/11121669.html
Copyright © 2020-2023  润新知