WebContent/resource/web/js/library/file_upload/main.js

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

var FormFileUpload = function () {

    return {
        //main function to initiate the module
        init: function () {

            // Initialize the jQuery File Upload widget:
            jQuery('#fileupload').fileupload({
                // Uncomment the following to send cross-domain cookies:
                //xhrFields: {withCredentials: true},
                url: 'server/php/'
            });

            // Load existing files:
            // Demo settings:
            jQuery.ajax({
                // Uncomment the following to send cross-domain cookies:
                //xhrFields: {withCredentials: true},
                url: jQuery('#fileupload').fileupload('option', 'url'),
                dataType: 'json',
                context: jQuery('#fileupload')[0],
                maxFileSize: 5000000,
                acceptFileTypes: /(\.|\/)(gif|jpe?g|png)jQuery/i,
                process: [{
                        action: 'load',
                        fileTypes: /^image\/(gif|jpeg|png)jQuery/,
                        maxFileSize: 20000000 // 20MB
                    }, {
                        action: 'resize',
                        maxWidth: 1440,
                        maxHeight: 900
                    }, {
                        action: 'save'
                    }
                ]
            }).done(function (result) {
                jQuery(this).fileupload('option', 'done')
                    .call(this, null, {
                    result: result
                });
            });

            // Upload server status check for browsers with CORS support:
            if (jQuery.support.cors) {
                jQuery.ajax({
                    url: 'server/php/',
                    type: 'HEAD'
                }).fail(function () {
                    jQuery('<span class="alert alert-error"/>')
                        .text('Upload server currently unavailable - ' +
                        new Date())
                        .appendTo('#fileupload');
                });
            }

            // initialize uniform checkboxes  
            App.initUniform('.uniform');
        }

    };
后面还有 2 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。