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"}
  • 相关阅读:
    Delphi 通过Access Violation地址错误找到错误的哪行代码
    GitHub 转载:github删除repository
    GitHub 转载:github的高级搜索
    SVN 转载:svn报错:privious operation has not finshed;run 'cleanup' if it was interrupted
    GitHub 转载:github新手使用
    Delphi 对应JAVA的MD5加密处理
    Delphi 对应JAVA的BASE64位加密处理
    Delphi 对应JAVA的URL编码处理
    python基础(五)
    DataFrame
  • 原文地址:https://www.cnblogs.com/chucklu/p/11121669.html
Copyright © 2011-2022 走看看